Make WordPress Core

Changeset 36137


Ignore:
Timestamp:
12/31/2015 11:51:09 AM (11 years ago)
Author:
afercia
Message:

Admin: Restore the "Show advanced menu properties" checkboxes IDs.

These checkboxes are used on the Menus screen options and the Customizer Menus options.
Their IDs were removed in [34991] but they're needed to get the checkboxes to be saved
via AJAX. Also, avoids a useless AJAX call.

Fixes #35112 for trunk.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r36089 r36137  
    999999                 *
    10001000                 * @since 4.4.0
    1001                  * 
     1001                 *
    10021002                 * @param bool      $show_button Whether to show Screen Options submit button.
    10031003                 *                               Default false.
    … …  
    10881088                        $id = "$column-hide";
    10891089                        echo '<label>';
    1090                         echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
     1090                        echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
    10911091                        echo "$title</label>\n";
    10921092                }
  • trunk/src/wp-admin/js/postbox.js

    r35809 r36137  
    5151                        this.init( page, args );
    5252
    53                         $handles.on( 'click.postboxes',  this.handle_click );
     53                        $handles.on( 'click.postboxes', this.handle_click );
    5454
    5555                        $('.postbox .hndle a').click( function(e) {
    … …  
    158158
    159159                save_state : function(page) {
    160                         var closed = $('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','),
    161                                 hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');
     160                        var closed, hidden;
     161
     162                        // Return on the nav-menus.php screen, see #35112.
     163                        if ( 'nav-menus' === page ) {
     164                                return;
     165                        }
     166
     167                        closed = $( '.postbox' ).filter( '.closed' ).map( function() { return this.id; } ).get().join( ',' );
     168                        hidden = $( '.postbox' ).filter( ':hidden' ).map( function() { return this.id; } ).get().join( ',' );
    162169
    163170                        $.post(ajaxurl, {
Note: See TracChangeset for help on using the changeset viewer.