我是一个WP初学者,看到了“Meta Box”插件的潜力(http://wordpress.org/plugins/meta-box/). 我已经激活了插件。到目前为止,我设法上传了演示。并在博客文章窗口中显示各种元框。
我已经阅读了文档,但仍然不知道如何注册自定义帖子类型的元框。如何实现它们?
到目前为止,我的自定义帖子类型(关于列出艺术家)的代码如下所示:
add_action(\'init\', \'add_cpt_artists\');
function add_cpt_artists() {
$labels = array(
\'name\' => _x(\'Artists\', \'post type general name\'),
\'singular_name\' => _x(\'Artist\', \'post type singular name\'),
\'add_new\' => _x(\'Add\', \'artist\'),
\'add_new_item\' => __(\'Add new artist\'),
\'edit_item\' => __(\'Edit artist\'),
\'new_item\' => __(\'New artist\'),
\'view_item\' => __(\'View artist\'),
\'search_items\' => __(\'Search for artist\'),
\'not_found\' => __(\'No artist found\'),
\'not_found_in_trash\' =>
__(\'No artist in trash\'),
\'parent_item_colon\' => \'\'
);
$supports = array(\'title\', \'editor\', \'thumbnail\', \'excerpt\');
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'_builtin\' => false,
\'show_in_menu\' => true,
\'query_var\' => true,
\'rewrite\' => array("slug" => "artists"),
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'has_archive\' => true,
\'hierarchical\' => false,
\'menu_position\' => 10,
\'supports\' => $supports
);
register_post_type(\'artists\',$args);
}
假设我想从Meta Box插件中添加两个文本区域和一个带有复选框的框。在哪里插入代码