From 42fbeea783a7132fd08084ce2fedfaa14b8bc63f Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 10 Nov 2010 00:42:43 +0000 Subject: [PATCH] Properly set up menu_name. We're handling it differently because it defaults off other labels. fixes #14832. git-svn-id: http://svn.automattic.com/wordpress/trunk@16268 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 0d3dba40f8..8286d88f3e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1124,7 +1124,7 @@ function _post_type_meta_capabilities( $capabilities = null ) { * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page: * - * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.) + * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages). * * @since 3.0.0 * @param object $post_type_object @@ -1162,6 +1162,9 @@ function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) { if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) $object->labels['singular_name'] = $object->labels['name']; + if ( !isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) ) + $object->labels['menu_name'] = $object->labels['name']; + $defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults ); $labels = array_merge( $defaults, $object->labels ); return (object)$labels;