Answers for "get name custom post type wordpress"

PHP
1

get name custom post type wordpress

$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;
Posted by: Guest on November-22-2020

Code answers related to "get name custom post type wordpress"

Browse Popular Code Answers by Language