Changeset 53207
- Timestamp:
- 04/18/2022 03:20:16 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/nav-menu.php
r50981 r53207 263 263 * 264 264 * @since 3.6.0 265 * @since 5.3.1 The `$ echo` parameter was added.265 * @since 5.3.1 The `$display` parameter was added. 266 266 * 267 267 * @global bool $one_theme_location_no_menus to determine if no menus exist 268 268 * 269 269 * @param int|string $nav_menu_selected_id ID, name, or slug of the currently selected menu. 270 * @param bool $ echo Whether to echoor just return the string.270 * @param bool $display Whether to display or just return the string. 271 271 * @return string|false Disabled attribute if at least one menu exists, false if not. 272 272 */ 273 function wp_nav_menu_disabled_check( $nav_menu_selected_id, $ echo= true ) {273 function wp_nav_menu_disabled_check( $nav_menu_selected_id, $display = true ) { 274 274 global $one_theme_location_no_menus; 275 275 … … 278 278 } 279 279 280 return disabled( $nav_menu_selected_id, 0, $ echo);280 return disabled( $nav_menu_selected_id, 0, $display ); 281 281 } 282 282 … … 326 326 * @global int|string $nav_menu_selected_id 327 327 * 328 * @param string $ object Not used.328 * @param string $item_object Not used. 329 329 * @param array $box { 330 330 * Post type menu item meta box arguments. … … 336 336 * } 337 337 */ 338 function wp_nav_menu_item_post_type_meta_box( $ object, $box ) {338 function wp_nav_menu_item_post_type_meta_box( $item_object, $box ) { 339 339 global $_nav_menu_placeholder, $nav_menu_selected_id; 340 340 … … 690 690 * @global int|string $nav_menu_selected_id 691 691 * 692 * @param string $ object Not used.692 * @param string $item_object Not used. 693 693 * @param array $box { 694 694 * Taxonomy menu item meta box arguments. … … 700 700 * } 701 701 */ 702 function wp_nav_menu_item_taxonomy_meta_box( $ object, $box ) {702 function wp_nav_menu_item_taxonomy_meta_box( $item_object, $box ) { 703 703 global $nav_menu_selected_id; 704 704 … … 990 990 * @access private 991 991 * 992 * @param object $ object The post type or taxonomy meta-object.992 * @param object $item_object The post type or taxonomy meta-object. 993 993 * @return object The post type or taxonomy object. 994 994 */ 995 function _wp_nav_menu_meta_box_object( $ object = null ) {996 if ( isset( $ object->name ) ) {997 998 if ( 'page' === $ object->name ) {999 $ object->_default_query = array(995 function _wp_nav_menu_meta_box_object( $item_object = null ) { 996 if ( isset( $item_object->name ) ) { 997 998 if ( 'page' === $item_object->name ) { 999 $item_object->_default_query = array( 1000 1000 'orderby' => 'menu_order title', 1001 1001 'post_status' => 'publish', … … 1003 1003 1004 1004 // Posts should show only published items. 1005 } elseif ( 'post' === $ object->name ) {1006 $ object->_default_query = array(1005 } elseif ( 'post' === $item_object->name ) { 1006 $item_object->_default_query = array( 1007 1007 'post_status' => 'publish', 1008 1008 ); 1009 1009 1010 1010 // Categories should be in reverse chronological order. 1011 } elseif ( 'category' === $ object->name ) {1012 $ object->_default_query = array(1011 } elseif ( 'category' === $item_object->name ) { 1012 $item_object->_default_query = array( 1013 1013 'orderby' => 'id', 1014 1014 'order' => 'DESC', … … 1017 1017 // Custom post types should show only published items. 1018 1018 } else { 1019 $ object->_default_query = array(1019 $item_object->_default_query = array( 1020 1020 'post_status' => 'publish', 1021 1021 ); … … 1023 1023 } 1024 1024 1025 return $ object;1025 return $item_object; 1026 1026 } 1027 1027
Note: See TracChangeset
for help on using the changeset viewer.