extend Meta Box / Document Panel
extend Meta Box / Document Panel
extend Meta Box / Document Panel
Well you can just use the WordPress loop with a custom query to throw all the data you need into arrays. For example if you want all the post titles in an array (using get_posts); $all_posts = get_posts(‘numberposts=-1’); $all_titles = array(); foreach( $all_posts as $all_post ) { $all_titles[] = $all_post->post_title; } As for using the … Read more
The fileurl should look like this: fileurl = $(‘a’, html).attr(‘href’); It’s a pretty simple fix. I would do some validation on this: if(/\.mp3\b/.test(fileurl)){ //Do something awesome }else{ alert(‘The file you selected is not an MP3.’); } Cheers!
you can make repeating fields with the WP alchemy class http://www.farinspace.com/wpalchemy-metabox/#have_fields_and_multi
Like Bainternet said in comments, you’ll need to mess with add_query_var as well as add_rewrite_rule. We usually do something similar to: global $wp; $wp->add_query_var( ‘some_var’ ); add_rewrite_rule( ‘some/path/([^/]+)/?$’, ‘index.php?some_var=$matches[1]’ ); See this WordPress Trac ticket, as well as documentation on add_query_var and add_rewrite_rule
Probably your already solved this (hopefully not by hand). This part of your question is intriguing: I found that if I open a post through WordPress front-end and then click “update” the custom field data and the post content “sync” Do you mean back-end, right? If so, I think a bulk update would solve this … Read more
take a look at the reference docs for the WP_Query class: http://codex.wordpress.org/Class_Reference/WP_Query something like this: $args = array( //some key/value pairs…whatever ‘meta_query => array( array( ‘key’ => somekey, ‘value’ => somevalue, ‘compare’ => some comparison operator ), array( ‘key’ => some other key, ‘value’ => some other value, ‘compare’ => some comparison operator ) ) … Read more
I see your problem in the javascript. I’ve done something similar using the “on close” event of the wp.media object. You can use the “select event”, as you are actually doing, but I would use “on select” event mainly for events within the modal window (but it is just preference, you can use the “on … Read more
I suggest a hierarchical custom post type and a conditional to create an additional loop on your single-{cpt}.php. By using hierarchical custom post type, you can create a sub-cpt , like a sub page as the stats part of it’s parent post. The sub-cpt then can be used to store additional data (e.g. in post_content … Read more
The 10 is the priority, 2 means that two variables are passed on to the function ( $column, $post_id ). I think the problem is trying to echo get_post_meta directly. Try this: function custom_employee_column( $column, $post_id ) { switch ( $column ) { case ‘location’ : $metaData = get_post_meta( $post_id , ‘location’ , true ); … Read more