📌  相关文章
📜  获取名称自定义帖子类型 wordpress - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:03.440000             🧑  作者: Mango

代码示例1
$pt = get_post_type_object( 'books' );

// These two usually contain the post type name in plural. 
// They may differ though.
echo $pt->label;
echo $pt->labels->name;

// This one holds the post type name in singular.
echo $pt->labels->singular_name;