From 93e3093a0a677e049b4bc8acd9f31d35af532a4f Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Thu, 31 Dec 2015 11:51:09 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/class-wp-screen.php | 4 ++-- src/wp-admin/js/postbox.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index c7b35a49ad..5a02928710 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -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 '\n"; } ?> diff --git a/src/wp-admin/js/postbox.js b/src/wp-admin/js/postbox.js index a4cdad8001..9d7a938d8a 100644 --- a/src/wp-admin/js/postbox.js +++ b/src/wp-admin/js/postbox.js @@ -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',