/ Published in: PHP
This function will loop all the registered post types, and for each post type create a meta box with given data. Here links is assimilated to post types
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
'id' => 'my-meta-box-1', 'title' => 'Custom meta box 1', 'context' => 'normal', 'priority' => 'high', 'name' => 'Text box', 'desc' => 'Enter something here', 'id' => $prefix . 'text', 'type' => 'text', 'std' => 'Default value 1' ) ) ); / Add meta box function mytheme_add_box() { global $meta_box; foreach ($meta_box['pages'] as $page) { add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $page, $meta_box['context'], $meta_box['priority']); } }
URL: http://www.deluxeblogtips.com/2010/05/howto-meta-box-wordpress.html