0
这里场是我在functions.php的definded所以战争使用自定义后类型在其他自定义后类型
function create_post_type(){
register_post_type('my_persons',
array('labels' =>
array(
'name' => __('Persons'),
'singular_name' => __('Person')
),
'public' => true,
'menu_position' => 5,
'rewrite' => array('slug' => 'persons'),
'supports' => array('title', 'editor','thumbnail')
)
);
register_post_type('my_shoes',
array('labels' =>
array(
'name' => __('Shoes'),
'singular_name' => __('Shoe')
),
'public' => true,
'menu_position' => 6,
'rewrite' => array('slug' => 'shoes'),
'supports' => array('title', 'editor')
)
);
}
add_action('init', 'create_post_type');
我想要做的是,添加新的人的时候,我想查看(已添加的)鞋子列表并选择(通过复选框)他拥有的鞋子。
我已经安装了“高级自定义字段”插件。我知道可以在那里定义一个CheckBox的鞋子列表,并将它用作人员的字段。但是我想在添加新的“Shoes”自定义帖子时动态填充此字段。
这很难解释,但我想你明白了。顺便说一下,我使用的是Wordpress 3.7.1,而且我对此完全陌生。
任何帮助表示赞赏;-)
我认为这个插件已经有一个custom_post_types的下拉列表。 –
如果是这样,我找不到它。 – amiroo
我混淆了下拉框的复选框。它有一个名为post_object的选项来生成下拉菜单(不是复选框,我想..)但看看我的答案。 YOu可以轻松过滤复选框。 –