Should custom meta boxes be able to output shortcodes the same as WordPress’ native post editor?

Short answer: no. Shortcodes are for injecting content directly in the Post Content, by the user, via the Post Edit screen. If your data are coming from a metabox, you have other, better, more efficient, and easier-to-control means of injecting content into the Post Content: primarily, the the_content filter (for general usage), or custom action … Read more

How to store multiple values in 1 meta_key with radio input?

John, I’m not sure how you have the radio button set up, but WordPress easily handles multiple values in one meta_key. You simply need to place the values in an array before sending it to update_post_meta. For instance: $array = array( ‘foo’ => ‘foo_value’, ‘bar’ => ‘bar_value’ ); update_post_meta( $id, ‘my_meta_key’, $array ); WordPress automatically … Read more

Post Meta not saving when have empty post

It’s default WordPress behavior. You cannot create, save or even trash “empty” posts (considering, for that last case, that you created one manually). Luckily, there’s a filter that allows you to override it and insert / save posts without need for title or content; insert this into your functions.php: add_filter(‘wp_insert_post_empty_content’, ‘__return_false’); I’ve successfully created a … Read more

get_post_type on post.php

Why can’t you just globalize $post and then get the post type? e.g. <?php global $post; $post_type = get_post_type( $post->ID ); ?> In what context are you placing this code? In a metabox callback, or what? (Also: why are you using $_GET data?)

Limit a meta box to a specific category

You might want to check out his other post: http://www.farinspace.com/show-hide-meta-box-by-category/ I figure you would need some javascript because if you change categories, you would need some way for the browser to trigger to show the metabox, hence javascript. He has a video tutorial, so that should help explain everything. Also, since you are already reading … Read more