get_post_type_labels()获取某个文章类型的所有label信息

目录

描述

Builds an object with all post type labels out of a post type object

Accepted keys of the label array in the post type object:

  • name - general name for the post type, usually plural. The same and overriden by $post_type_object->label. Default is Posts/Pages
  • singular_name - name for one object of this post type. Default is Post/Page
  • add_new - Default is Add New for both hierarchical and non-hierarchical types. When internationalizing this string, please use a {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context gettext context} matching your post type. Example: _x('Add New', 'product');
  • add_new_item - Default is Add New Post/Add New Page
  • edit_item - Default is Edit Post/Edit Page
  • new_item - Default is New Post/New Page
  • view_item - Default is View Post/View Page
  • search_items - Default is Search Posts/Search Pages
  • not_found - Default is No posts found/No pages found
  • not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
  • parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:

Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages).

get_post_type_labels() 描述

用法

<?php get_post_type_labels$post_type_object ); ?>

get_post_type_labels() 用法

参数

$post_type_object

(object) (必填)

默认值: None

get_post_type_labels() 参数

返回值

(object

object with all the labels as member variables

get_post_type_labels() 返回值

历史

添加于 版本: 3.0

get_post_type_labels() 历史