How to get custom post type menu_name?

Hi @mike23:

This code shows you how to get both singular and plural names (assuming you specified them as such in your register_post_type()).

Note that the code example is presented as a standalone file you can save as test.php file in the root of your website and load in your browser with http://yoursite.com/test.php (assuming you replace yoursite.com with your site’s domain!):

<?php
/*
Filename: test.php
*/
include( '../wp-load.php' );
header( 'Content-type:text/plain' );

$post_type_object = get_post_type_object('p_project_plans');

echo "Singular: {$post_type_object->labels->singular_name}\n";
echo "Plural: {$post_type_object->labels->name}\n";