我的自定义帖子类型没有显示插件

时间:2015-07-01 作者:Meglio

按如下方式注册自定义post类型,不会显示slug输入。知道为什么吗?

res = register_post_type( \'twig_anything_tmplt\', [
        \'label\' => \'Twig Templates\',
        \'labels\' => [
            \'name\' => \'Twig Templates\',
            \'singular_name\' => \'Twig Template\',
            \'menu_name\' => \'Twig Templates\',
            \'add_new_item\' => \'Add New Twig Template\',
            \'edit_item\' => \'Edit Twig Template\',
            \'new_item\' => \'New Twig Template\',
            \'view_item\' => \'View Twig Template\',
            \'search_items\' => \'Search Twig Templates\',
            \'not_found\' => \'No Twig templates found\',
            \'not_found_in_trash\' => \'No Twig templates found in trash\',
        ],
        \'description\' => \'Twig templates used by the Twig Anything plugin.\',
        \'exclude_from_search\' => true,
        \'publicly_queryable\' => false,
        \'show_ui\' => true,
        \'show_in_menu\' => true,
        \'show_in_admin_bar\' => true,
        \'menu_position\' => 20,
        \'menu_icon\' => \'dashicons-images-alt2\',
        \'hierarchical\' => false,
        \'supports\' => [\'title\', \'editor\'],
        \'has_archive\' => false,
        \'rewrite\' => [
            \'slug\' => \'twig_anything_tmplt\',
            \'with_front\' => true,
            \'feeds\' => false,
            \'pages\' => false,
        ]
    ]);

1 个回复
SO网友:Bainternet

您只需单击“屏幕选项”,并确保选中复选框即可

enter image description here

结束

相关推荐