wp_nav_menu_disabled_check

函数


wp_nav_menu_disabled_check ( $nav_menu_selected_id, $display = true )
参数
  • (int|string)
    $nav_menu_selected_id
    ID, name, or slug of the currently selected menu.
    Required:
  • (bool)
    $display
    Whether to display or just return the string.
    Required:
    Default: true
返回值
  • (string|false) Disabled attribute if at least one menu exists, false if not.
定义位置
  • wp-admin/includes/nav-menu.php
    , line 273
引入
3.6.0
弃用

Check whether to disable the Menu Locations meta box submit button and inputs.

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, $display );
}