From 7d70dabf5970d8c5c5fb18f02a23ddede308b8c5 Mon Sep 17 00:00:00 2001 From: "David A. Kennedy" Date: Tue, 20 Dec 2016 22:17:40 +0000 Subject: [PATCH] Twenty Seventeen: Ensure functions in `customize-controls.js` don't count on Customizer sections always being present Before, the code assumed the `theme_options` section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur. Props westonruter. Fixes #39335. Built from https://develop.svn.wordpress.org/trunk@39623 git-svn-id: http://core.svn.wordpress.org/trunk@39563 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../twentyseventeen/assets/js/customize-controls.js | 10 ++++++---- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentyseventeen/assets/js/customize-controls.js b/wp-content/themes/twentyseventeen/assets/js/customize-controls.js index b8e7e8160c..e6f6037a4d 100644 --- a/wp-content/themes/twentyseventeen/assets/js/customize-controls.js +++ b/wp-content/themes/twentyseventeen/assets/js/customize-controls.js @@ -25,10 +25,12 @@ }); // Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly. - wp.customize.section( 'theme_options' ).expanded.bind( function( isExpanding ) { + wp.customize.section( 'theme_options', function( section ) { + section.expanded.bind( function( isExpanding ) { - // Value of isExpanding will = true if you're entering the section, false if you're leaving it. - wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding }); - }); + // Value of isExpanding will = true if you're entering the section, false if you're leaving it. + wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding }); + } ); + } ); }); })( jQuery ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 7cd3484394..b0ca708cbc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39622'; +$wp_version = '4.8-alpha-39623'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.