diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php index 4475d08f96..d3b09ce5df 100644 --- a/src/wp-admin/includes/nav-menu.php +++ b/src/wp-admin/includes/nav-menu.php @@ -262,22 +262,22 @@ function wp_nav_menu_taxonomy_meta_boxes() { * Check whether to disable the Menu Locations meta box submit button and inputs. * * @since 3.6.0 - * @since 5.3.1 The `$echo` parameter was added. + * @since 5.3.1 The `$display` parameter was added. * * @global bool $one_theme_location_no_menus to determine if no menus exist * * @param int|string $nav_menu_selected_id ID, name, or slug of the currently selected menu. - * @param bool $echo Whether to echo or just return the string. + * @param bool $display Whether to display or just return the string. * @return string|false Disabled attribute if at least one menu exists, false if not. */ -function wp_nav_menu_disabled_check( $nav_menu_selected_id, $echo = true ) { +function wp_nav_menu_disabled_check( $nav_menu_selected_id, $display = true ) { global $one_theme_location_no_menus; if ( $one_theme_location_no_menus ) { return false; } - return disabled( $nav_menu_selected_id, 0, $echo ); + return disabled( $nav_menu_selected_id, 0, $display ); } /** @@ -325,7 +325,7 @@ function wp_nav_menu_item_link_meta_box() { * @global int $_nav_menu_placeholder * @global int|string $nav_menu_selected_id * - * @param string $object Not used. + * @param string $item_object Not used. * @param array $box { * Post type menu item meta box arguments. * @@ -335,7 +335,7 @@ function wp_nav_menu_item_link_meta_box() { * @type WP_Post_Type $args Extra meta box arguments (the post type object for this meta box). * } */ -function wp_nav_menu_item_post_type_meta_box( $object, $box ) { +function wp_nav_menu_item_post_type_meta_box( $item_object, $box ) { global $_nav_menu_placeholder, $nav_menu_selected_id; $post_type_name = $box['args']->name; @@ -689,7 +689,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) { * * @global int|string $nav_menu_selected_id * - * @param string $object Not used. + * @param string $item_object Not used. * @param array $box { * Taxonomy menu item meta box arguments. * @@ -699,7 +699,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) { * @type object $args Extra meta box arguments (the taxonomy object for this meta box). * } */ -function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) { +function wp_nav_menu_item_taxonomy_meta_box( $item_object, $box ) { global $nav_menu_selected_id; $taxonomy_name = $box['args']->name; @@ -989,40 +989,40 @@ function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) { * * @access private * - * @param object $object The post type or taxonomy meta-object. + * @param object $item_object The post type or taxonomy meta-object. * @return object The post type or taxonomy object. */ -function _wp_nav_menu_meta_box_object( $object = null ) { - if ( isset( $object->name ) ) { +function _wp_nav_menu_meta_box_object( $item_object = null ) { + if ( isset( $item_object->name ) ) { - if ( 'page' === $object->name ) { - $object->_default_query = array( + if ( 'page' === $item_object->name ) { + $item_object->_default_query = array( 'orderby' => 'menu_order title', 'post_status' => 'publish', ); // Posts should show only published items. - } elseif ( 'post' === $object->name ) { - $object->_default_query = array( + } elseif ( 'post' === $item_object->name ) { + $item_object->_default_query = array( 'post_status' => 'publish', ); // Categories should be in reverse chronological order. - } elseif ( 'category' === $object->name ) { - $object->_default_query = array( + } elseif ( 'category' === $item_object->name ) { + $item_object->_default_query = array( 'orderby' => 'id', 'order' => 'DESC', ); // Custom post types should show only published items. } else { - $object->_default_query = array( + $item_object->_default_query = array( 'post_status' => 'publish', ); } } - return $object; + return $item_object; } /**