WordPress获取文章类型对象函数:get_post_type_object
WordPress函数get_post_type_object根据文章类型名称获取文章类型数据,返回的结果参考get_post_types()函数$output值为objects时返回的数据。 get_post_type_object( string $post_type ) 函数参数$post_type 字符串 文章类型 函数使用示例$obj = get_post_type_object( 'post' ); echo $obj->labels->singular_name; 扩展阅读get_post_type_object()函数位于:wp-includes/post.php …