From 5861cd15ae14a3c7515db3aa80b16f9a5cd425fa Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@16268 602fd350-edb4-49c9-b593-d223f7449a82 --- 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;