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.

git-svn-id: https://develop.svn.wordpress.org/trunk@36137 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2015-12-31 11:51:09 +00:00
parent 7ce16f660e
commit 93e3093a0a
2 changed files with 12 additions and 5 deletions

View File

@ -998,7 +998,7 @@ final class WP_Screen {
* Filter whether to show the Screen Options submit button.
*
* @since 4.4.0
*
*
* @param bool $show_button Whether to show Screen Options submit button.
* Default false.
* @param WP_Screen $this Current WP_Screen instance.
@ -1087,7 +1087,7 @@ final class WP_Screen {
$id = "$column-hide";
echo '<label>';
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
echo "$title</label>\n";
}
?>

View File

@ -50,7 +50,7 @@ var postboxes;
this.page = page;
this.init( page, args );
$handles.on( 'click.postboxes', this.handle_click );
$handles.on( 'click.postboxes', this.handle_click );
$('.postbox .hndle a').click( function(e) {
e.stopPropagation();
@ -157,8 +157,15 @@ var postboxes;
},
save_state : function(page) {
var closed = $('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','),
hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');
var closed, hidden;
// Return on the nav-menus.php screen, see #35112.
if ( 'nav-menus' === page ) {
return;
}
closed = $( '.postbox' ).filter( '.closed' ).map( function() { return this.id; } ).get().join( ',' );
hidden = $( '.postbox' ).filter( ':hidden' ).map( function() { return this.id; } ).get().join( ',' );
$.post(ajaxurl, {
action: 'closed-postboxes',