WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got some custom post types where i deregistered the "title" meta box. Now i always get "Auto Draft" as title. To avoid this i'd like to add the name of a taxonomy as the title. But how would i check if the meta box "title" exists or not?

share|improve this question
up vote 0 down vote accepted

Check the metabox global directly?

$wp_meta_boxes['YOURTYPE'] should hold data on metaboxes for a given type.

Had a quick look in wp-admin/includes/template.php but i can't see any convenience functions for extracting metabox information from the array so you'll probably need to create your own code to loop over or extract the necessary info from it.

Of course make sure you run your code after the add_meta_boxes actions(else they'll likely not exist at the point you run your code).

share|improve this answer
It's exactly (or better said, should exactly be - no success so far): $wp_meta_boxes['bills']['high']['post_title'] – kaiser Feb 24 '11 at 17:28
That'll be because the title is not a metabox, maybe run your conditional logic in the same way core does decides whether to show that field, ie. if ( post_type_supports( 'bills', 'title') ) { ? – t31os Feb 24 '11 at 17:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.