Make WordPress Core

Ticket #54799: 54799.patch

File 54799.patch, 1.2 KB (added by krishaweb, 3 years ago)

Here is the patch to remove the bulk action button when a menu item is empty.

  • src/wp-admin/nav-menus.php

    diff --git a/src/wp-admin/nav-menus.php b/src/wp-admin/nav-menus.php
    index d340fb6b67..e91c98f42c 100644
    a b require_once ABSPATH . 'wp-admin/admin-header.php'; 
    992992                                                                        <p><?php echo $starter_copy; ?></p>
    993993                                                                </div>
    994994
    995                                                                 <?php if ( ! $add_new_screen ) : ?>
     995                                                                <?php if ( ! $add_new_screen && ! empty( $menu_items ) ) : ?>
    996996                                                                        <div id="nav-menu-bulk-actions-top" class="bulk-actions">
    997997                                                                                <label class="bulk-select-button" for="bulk-select-switcher-top">
    998998                                                                                        <input type="checkbox" id="bulk-select-switcher-top" name="bulk-select-switcher-top" class="bulk-select-switcher">
    require_once ABSPATH . 'wp-admin/admin-header.php'; 
    10271027                                                        }
    10281028                                                        ?>
    10291029
    1030                                                         <?php if ( ! $add_new_screen ) : ?>
     1030                                                        <?php if ( ! $add_new_screen && ! empty( $menu_items ) ) : ?>
    10311031                                                                <div id="nav-menu-bulk-actions-bottom" class="bulk-actions">
    10321032                                                                        <label class="bulk-select-button" for="bulk-select-switcher-bottom">
    10331033                                                                                <input type="checkbox" id="bulk-select-switcher-bottom" name="bulk-select-switcher-top" class="bulk-select-switcher">