wp_nav_menu_disabled_check

The timeline below displays how wordpress function wp_nav_menu_disabled_check has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Check whether to disable the Menu Locations meta box submit button and inputs.
 *
 * @since 3.6.0
 * @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       $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, $display = true)
{
    global $one_theme_location_no_menus;
    if ($one_theme_location_no_menus) {
        return false;
    }
    return disabled($nav_menu_selected_id, 0, $display);
}

WordPress Version: 3.1

/**
 * 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.
 *
 * @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.
 * @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)
{
    global $one_theme_location_no_menus;
    if ($one_theme_location_no_menus) {
        return false;
    }
    return disabled($nav_menu_selected_id, 0, $echo);
}

WordPress Version: 4.5

/**
 * Check whether to disable the Menu Locations meta box submit button
 *
 * @since 3.6.0
 *
 * @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
 * @return string Disabled attribute if at least one menu exists, false if not
 */
function wp_nav_menu_disabled_check($nav_menu_selected_id)
{
    global $one_theme_location_no_menus;
    if ($one_theme_location_no_menus) {
        return false;
    }
    return disabled($nav_menu_selected_id, 0);
}

WordPress Version: 4.3

/**
 * Check whether to disable the Menu Locations meta box submit button
 *
 * @since 3.6.0
 *
 * @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
 * @return string Disabled attribute if at least one menu exists, false if not
*/
function wp_nav_menu_disabled_check($nav_menu_selected_id)
{
    global $one_theme_location_no_menus;
    if ($one_theme_location_no_menus) {
        return false;
    }
    return disabled($nav_menu_selected_id, 0);
}

WordPress Version: 4.1

/**
 * Check whether to disable the Menu Locations meta box submit button
 *
 * @since 3.6.0
 *
 * @uses global $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
 * @return string Disabled attribute if at least one menu exists, false if not
*/
function wp_nav_menu_disabled_check($nav_menu_selected_id)
{
    global $one_theme_location_no_menus;
    if ($one_theme_location_no_menus) {
        return false;
    }
    return disabled($nav_menu_selected_id, 0);
}

WordPress Version: 3.7

/**
 * Check whether to disable the Menu Locations meta box submit button
 *
 * @since 3.6.0
 *
 * @uses global $one_theme_location_no_menus to determine if no menus exist
 * @uses disabled() to output the disabled attribute in $other_attributes param in submit_button()
 *
 * @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu
 * @return string Disabled attribute if at least one menu exists, false if not
*/
function wp_nav_menu_disabled_check($nav_menu_selected_id)
{
    global $one_theme_location_no_menus;
    if ($one_theme_location_no_menus) {
        return false;
    }
    return disabled($nav_menu_selected_id, 0);
}