不能创建5个以上的自定义帖子类型

时间:2014-09-10 作者:sledgeweight

我注册了6个,但在wp admin菜单上似乎只输出了5个。如果我删除其中一个,它会相应地更新,所以据我所知,每个配置都是正确的。我还停用了所有插件并更改了菜单位置。

add_action(\'init\', \'register_my_cpt_organisation\');
function register_my_cpt_organisation() {
    register_post_type(\'organisation_profiles\', array(
        \'label\' => \'Organisation Profiles\',
        \'description\' => \'\',
        \'public\' => true,
        \'show_ui\' => true,
        \'menu_position\' => 15,
        \'show_in_menu\' => true,
        \'capability_type\' => \'post\',
        \'map_meta_cap\' => true,
        \'hierarchical\' => false,
         \'rewrite\' => array( \'slug\' => \'organisation-profiles\', \'with_front\' => true),
        \'query_var\' => true,
        \'supports\' => array( \'title\', \'editor\', \'excerpt\', \'trackbacks\', \'custom-   fields\', \'comments\', \'revisions\', \'thumbnail\', \'author\', \'page-attributes\' ),
        \'labels\' => array (
            \'name\' => \'Organisation Profiles\',
            \'singular_name\' => \'Team Memeber\',
            \'menu_name\' => \'Team\',
            \'add_new\' => \'Add a Team Memeber\',
            \'add_new_item\' => \'Add New Team Memeber\',
            \'edit\' => \'Edit\',
            \'edit_item\' => \'Edit Team Memeber\',
            \'new_item\' => \'New Team Memeber\',
            \'view\' => \'View Team Memeber\',
            \'view_item\' => \'View Team Memeber\',
            \'search_items\' => \'Search Team Memebers\',
            \'not_found\' => \'No Team Memeber Found\',
            \'not_found_in_trash\' => \'No Team Memeber Found in Trash\',
            \'parent\' => \'Team\',
        )
    )
    );
}

1 个回复
最合适的回答,由SO网友:Dave Romsey 整理而成

您可以注册的帖子类型数量没有限制,但我注意到您的CPT名称“Organization\\u profiles”有22个字符。超过中指定的20个字符的限制docs 对于$post_type 参数

结束

相关推荐