Make WordPress Core

Changeset 51006

Timestamp:
05/25/2021 05:41:11 PM (3 years ago)
Author:
joedolson
Message:

Menus: Add bulk delete for menu items.

Adds an option to bulk delete menu items from the core Navigation Menus screen, offering a considerable usability benefit when making significant changes to navigation menus.

Uses the bulk select pattern found in post and media lists for consistency with other core management screens, rather than the rapid delete pattern found in menus in the customizer.

Props wphound, welcher, melchoyce, maxpertici, audrasjb
Fixes #21603.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/nav-menu.js

    r50547 r51006  
    4545
    4646            this.attachMenuEditListeners();
     47
     48
     49
     50
     51
    4752
    4853            this.attachQuickSearchListeners();
    ���  
    863868        },
    864869
     870
     871
     872
     873
     874
     875
     876
     877
     878
     879
     880
     881
     882
     883
     884
     885
     886
     887
     888
     889
     890
     891
     892
     893
     894
     895
     896
     897
     898
     899
     900
     901
     902
     903
     904
     905
     906
     907
     908
     909
     910
     911
     912
     913
     914
     915
     916
     917
     918
     919
     920
     921
     922
     923
     924
     925
     926
     927
     928
     929
     930
     931
     932
     933
     934
     935
     936
     937
     938
     939
     940
     941
     942
     943
     944
     945
     946
     947
     948
     949
     950
     951
     952
     953
     954
     955
     956
     957
     958
     959
     960
     961
     962
     963
     964
     965
     966
     967
     968
     969
     970
     971
     972
     973
     974
     975
     976
     977
     978
     979
     980
     981
     982
     983
     984
     985
     986
     987
     988
     989
     990
     991
     992
     993
     994
     995
     996
     997
     998
     999
     1000
     1001
     1002
     1003
     1004
     1005
     1006
     1007
     1008
     1009
     1010
     1011
     1012
     1013
     1014
     1015
     1016
     1017
     1018
     1019
     1020
     1021
     1022
     1023
     1024
     1025
     1026
     1027
     1028
     1029
     1030
     1031
     1032
     1033
     1034
     1035
     1036
     1037
     1038
     1039
     1040
     1041
     1042
     1043
     1044
     1045
     1046
    8651047        attachMenuSaveSubmitListeners : function() {
    8661048            /*
     
    9091091                searchTimer = setTimeout( function() {
    9101092                    api.updateQuickSearchResults( $this );
    911                 }, 500 );
     1093                }, 500 );
    9121094            }).on( 'blur', '.quick-search', function() {
    9131095                api.lastSearch = '';
  • trunk/src/wp-admin/css/nav-menus.css

    r50782 r51006  
    9696.menu-edit #post-body-content h3 {
    9797    margin: 1em 0 10px;
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
    98197}
    99198
     
    480579    /* @todo: responsive view. */
    481580    margin-right: 13em;
     581
     582
     583
     584
     585
     586
     587
     588
     589
    482590}
    483591
  • trunk/src/wp-admin/includes/class-walker-nav-menu-edit.php

    r50767 r51006  
    119119            <div class="menu-item-bar">
    120120                <div class="menu-item-handle">
    121                     <span class="item-title"><span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span></span>
     121                    <>
    122122                    <span class="item-controls">
    123123                        <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
  • trunk/src/wp-admin/nav-menus.php

    r50938 r51006  
    486486    /* translators: 1: Item name, 2: Item position, 3: Parent item name. */
    487487    'subMenuFocus'            => __( '%1$s. Sub item number %2$d under %3$s.' ),
     488
     489
     490
     491
    488492);
    489493wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );
     
    962966                        <div id="post-body-content" class="wp-clearfix">
    963967                            <?php if ( ! $add_new_screen ) : ?>
    964 
    965968                                <?php
    966969                                $hide_style = '';
     
    979982                                    <p><?php echo $starter_copy; ?></p>
    980983                                </div>
    981 
     984                                <div id="nav-menu-bulk-actions-top" class="bulk-actions">
     985                                    <label class="bulk-select-button" for="bulk-select-switcher-top">
     986                                        <input type="checkbox" id="bulk-select-switcher-top" name="bulk-select-switcher-top" class="bulk-select-switcher">
     987                                        <span class="bulk-select-button-label"><?php echo __( 'Bulk Select' ) ; ?></span>
     988                                    </label>
     989                                </div>
    982990                                <?php
    983991                                if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {
     
    10051013                            }
    10061014                            ?>
     1015
     1016
     1017
     1018
     1019
     1020
     1021
     1022
     1023
     1024
     1025
    10071026                            <div class="menu-settings" <?php echo $no_menus_style; ?>>
    10081027                                <h3><?php _e( 'Menu Settings' ); ?></h3>
Note: See TracChangeset for help on using the changeset viewer.