I am creating a WP theme with a built in custom post type (and I am using WPAlchemy to add a couple of custom metaboxes).
$theme_custom_metabox = new WPAlchemy_MetaBox(
array(
'id' => 'my_metabox',
'title' => 'Custom Metabox',
'context' => 'normal',
'autosave' => TRUE,
'types' => array('post', 'page', 'theme_custom_post_type'), // Can I add all custom_post_types by default here?
'priority' => 'high',
'mode' => WPALCHEMY_MODE_EXTRACT,
'template' => MY_PATH . '/includes/my_theme/metaboxes/my_metabox.php',
));
Reason: 'Out of the box', WPAlchemny requires you to list the post_types in the 'types' array - this works fine if you know all the post_types
being used, but this is a theme to be shipped so the actual CPTs being used would be unknown.
I would like the theme to programmatically add its metaboxes to any custom_post_types the user would add.
I guess the most logical way would be to store all CPTs in a variable. eg:
$all_cpt = all_custom_post_keys();
...
'types' => $all_cpt,
...