From 36e46af382f6c9cdfb8cb6a4d55e236d4c50fddf Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Sun, 17 Jul 2016 21:14:29 +0000 Subject: [PATCH] Twenty Thirteen: Fix selective refresh of Masonry-laid out widgets by deferring initialization until DOM ready. This ensures that the `wp.customize.selectiveRefresh` object will be available when in the Customizer preview. Fixes #37390. Props westonruter, celloexpressions. Built from https://develop.svn.wordpress.org/trunk@38083 git-svn-id: http://core.svn.wordpress.org/trunk@38024 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentythirteen/functions.php | 2 +- wp-content/themes/twentythirteen/js/functions.js | 12 ++++++++---- wp-includes/version.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index a2337b2a43..83993ced27 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -173,7 +173,7 @@ function twentythirteen_scripts_styles() { wp_enqueue_script( 'jquery-masonry' ); // Loads JavaScript file with functionality specific to Twenty Thirteen. - wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true ); + wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160717', true ); // Add Source Sans Pro and Bitter fonts, used in the main stylesheet. wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null ); diff --git a/wp-content/themes/twentythirteen/js/functions.js b/wp-content/themes/twentythirteen/js/functions.js index e0d759b9cb..88e8d0b5a7 100644 --- a/wp-content/themes/twentythirteen/js/functions.js +++ b/wp-content/themes/twentythirteen/js/functions.js @@ -119,9 +119,13 @@ /** * Arranges footer widgets vertically. */ - if ( $.isFunction( $.fn.masonry ) ) { - var columnWidth = body.is( '.sidebar' ) ? 228 : 245, - widgetArea = $( '#secondary .widget-area' ); + $( function() { + var columnWidth, widgetArea; + if ( ! $.isFunction( $.fn.masonry ) ) { + return; + } + columnWidth = body.is( '.sidebar' ) ? 228 : 245; + widgetArea = $( '#secondary .widget-area' ); widgetArea.masonry( { itemSelector: '.widget', @@ -157,5 +161,5 @@ } } ); } - } + } ); } )( jQuery ); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 4d85c0675c..7f10e14eda 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta3-38082'; +$wp_version = '4.6-beta3-38083'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.