Changeset 46842 for trunk/src/wp-admin/includes/nav-menu.php
- Timestamp:
- 12/09/2019 01:47:12 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/nav-menu.php
r46826 r46842 256 256 257 257 /** 258 * Check whether to disable the Menu Locations meta box submit button 258 * Check whether to disable the Menu Locations meta box submit button and inputs. 259 259 * 260 260 * @since 3.6.0 261 * @since 5.3.1 The `$echo` parameter was added. 261 262 * 262 263 * @global bool $one_theme_location_no_menus to determine if no menus exist 263 264 * 264 * @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu 265 * @return string Disabled attribute if at least one menu exists, false if not 266 */ 267 function wp_nav_menu_disabled_check( $nav_menu_selected_id ) { 265 * @param int|string $nav_menu_selected_id ID, name, or slug of the currently selected menu. 266 * @param bool $echo Whether to echo or just return the string. 267 * @return string|false Disabled attribute if at least one menu exists, false if not. 268 */ 269 function wp_nav_menu_disabled_check( $nav_menu_selected_id, $echo = true ) { 268 270 global $one_theme_location_no_menus; 269 271 … … 272 274 } 273 275 274 return disabled( $nav_menu_selected_id, 0 );276 return disabled( $nav_menu_selected_id, 0, $echo ); 275 277 } 276 278 … … 293 295 <p id="menu-item-url-wrap" class="wp-clearfix"> 294 296 <label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label> 295 <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" placeholder="https://" />297 <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="code menu-item-textbox" placeholder="https://" /> 296 298 </p> 297 299 298 300 <p id="menu-item-name-wrap" class="wp-clearfix"> 299 301 <label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label> 300 <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox" />302 <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="regular-text menu-item-textbox" /> 301 303 </p> 302 304 … … 570 572 <p class="quick-search-wrap"> 571 573 <label for="quick-search-posttype-<?php echo $post_type_name; ?>" class="screen-reader-text"><?php _e( 'Search' ); ?></label> 572 <input type="search" class="quick-search" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" id="quick-search-posttype-<?php echo $post_type_name; ?>" />574 <input type="search"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="quick-search" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" id="quick-search-posttype-<?php echo $post_type_name; ?>" /> 573 575 <span class="spinner"></span> 574 576 <?php submit_button( __( 'Search' ), 'small quick-search-submit hide-if-js', 'submit', false, array( 'id' => 'submit-quick-search-posttype-' . $post_type_name ) ); ?> … … 652 654 <p class="button-controls wp-clearfix" data-items-type="posttype-<?php echo esc_attr( $post_type_name ); ?>"> 653 655 <span class="list-controls hide-if-no-js"> 654 <input type="checkbox" id="<?php echo esc_attr( $post_type_name . '-tab' ); ?>" class="select-all" />656 <input type="checkbox"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> id="<?php echo esc_attr( $post_type_name . '-tab' ); ?>" class="select-all" /> 655 657 <label for="<?php echo esc_attr( $post_type_name . '-tab' ); ?>"><?php _e( 'Select All' ); ?></label> 656 658 </span> … … 881 883 <p class="button-controls wp-clearfix" data-items-type="taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>"> 882 884 <span class="list-controls hide-if-no-js"> 883 <input type="checkbox" id="<?php echo esc_attr( $taxonomy_name . '-tab' ); ?>" class="select-all" />885 <input type="checkbox"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> id="<?php echo esc_attr( $taxonomy_name . '-tab' ); ?>" class="select-all" /> 884 886 <label for="<?php echo esc_attr( $taxonomy_name . '-tab' ); ?>"><?php _e( 'Select All' ); ?></label> 885 887 </span>
Note: See TracChangeset
for help on using the changeset viewer.