【问题标题】:Create custom post type wordpress: change the labels创建自定义帖子类型 wordpress:更改标签
【发布时间】:2014-04-11 20:22:45
【问题描述】:

我已经注册了我的自定义帖子类型,但我想知道如何更改标题下方显示的“全部”标签。

例如,在帖子类别中,我有“所有帖子”,对于媒体,我可以看到图书馆......但是在我创建了自定义帖子类型之后,我的“所有”项目与主要项目具有相同的名称。

这是我创建的标签数组。

$labels = array(
    'name' => _x('Facebook', 'post type general name'),
    'singular_name' => _x('Facebook', 'post type singular name'),
    'add_new' => _x('Add New', 'Facebook'),
    'add_new_item' => __("Add New Facebook Post"),
    'edit_item' => __("Edit Facebook Post"),
    'new_item' => __("New Facebook Post"),
    'view_item' => __("View Facebook Posts"),
    'search_items' => __("Search in Facebook Posts"),
    'not_found' =>  __('No facebook posts found'),
    'not_found_in_trash' => __('No facebook posts found in Trash'), 
    'parent_item_colon' => ''
  );

通过更改名称或 Singular_name,“标题”和“全部”菜单项都会更改。我只能怀疑缺少一个标签,但我找不到这方面的任何文档。

有什么帮助吗?

谢谢

【问题讨论】:

    标签: php wordpress custom-type


    【解决方案1】:

    使用“all_items'”标签

    'all_items' => 'All Facebook Posts',
    

    【讨论】:

      【解决方案2】:

      试试这个插件Custom Post Type UI

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-13
        • 2015-11-06
        • 2023-04-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多