function get_post_type_labels( $post_type_object ) {}

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:


  • object $post_type_object

Return values

returns:with all the labels as member variables

Source code

function get_post_type_labels( $post_type_object ) {

	$nohier_vs_hier_defaults = array(

		'name' => array( _x('Posts', 'post type general name'), _x('Pages', 'post type general name') ),

		'singular_name' => array( _x('Post', 'post type singular name'), _x('Page', 'post type singular name') ),

		'add_new' => array( _x('Add New', 'post'), _x('Add New', 'page') ),

		'add_new_item' => array( __('Add New Post'), __('Add New Page') ),

		'edit_item' => array( __('Edit Post'), __('Edit Page') ),

		'new_item' => array( __('New Post'), __('New Page') ),

		'view_item' => array( __('View Post'), __('View Page') ),

		'search_items' => array( __('Search Posts'), __('Search Pages') ),

		'not_found' => array( __('No posts found.'), __('No pages found.') ),

		'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),

		'parent_item_colon' => array( null, __('Parent Page:') ),

		'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) )


	$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];

	return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: