我正在尝试创建一个自定义帖子类型,该类型应该用于出版物问题->文章结构。因为层次结构是really only meant for pages (参见hierarchical
节的注释),我想我应该配置自定义帖子类型作为页面。
太好了,只是我不能让它正常工作。即使在设置之后capability_type
到page
和hierarchical
到true
, 帖子类型的编辑屏幕仍像帖子一样工作。没有任何“父”或“页面模板”属性下拉菜单。
如果我更改capability_type
从…起page
到post
, 实际上,编辑屏幕没有任何变化。
这是我的代码:
register_post_type(\'publication\', array(
\'label\' => \'Publication\',
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'capability_type\' => \'page\',
\'map_meta_cap\' => true,
\'hierarchical\' => true,
\'rewrite\' => array(\'slug\' => \'publication\', \'with_front\' => true),
\'query_var\' => true,
\'supports\' => array(\'title\',\'editor\',\'comments\',\'revisions\',\'author\',\'page-attributes\'),
\'labels\' => array (
\'name\' => \'Publications\',
\'singular_name\' => \'Publication\',
\'menu_name\' => \'Publications\',
)
));
你知道这里怎么了吗?