PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
← All changes | addons/theme-builder/assets.php +6 -4 2.8.1 → 2.14.0 View file →
@@ -238,9 +238,8 @@
238 238 'header',
239 239 'footer'
240 240 ];
241 241
242 - $CoreAssets = new CoreAssets();
243 242 $FileUpload = new FileUpload();
244 243 foreach ( $template_types as $template_type ) {
245 244 $post_id = Helper::get_template_id( $template_type );
246 245 if ( $post_id ) {
@@ -254,11 +253,14 @@
254 253 }
255 254 $js_file_path = $FileUpload->get_file_path( $post_id . '.min.js' );
256 255 if ( file_exists( $js_file_path ) ) {
257 256 $js_file_url = $FileUpload->get_file_url( $post_id . '.min.js' );
258 - wp_enqueue_script( 'ablocks-blocks-' . $template_type . '-' . $post_id . '-combine-script', $js_file_url, array(), filemtime( $js_file_path ), true );
259 - wp_localize_script( 'ablocks-blocks-' . $template_type . '-' . $post_id . '-combine-script', 'ABlocksGlobal', $CoreAssets->get_localize_frontend_data() );
257 + // One shared ABlocksGlobal for the whole page: without this each
258 + // template type (header/footer/single/archive) printed its own
259 + // identical copy on top of the page combine script's.
260 + wp_enqueue_script( 'ablocks-blocks-' . $template_type . '-' . $post_id . '-combine-script', $js_file_url, array( 'ablocks-globals' ), filemtime( $js_file_path ), true );
261 + CoreAssets::localize_globals_once();
260 262 }
261 263 }
262 - }
264 + }//end foreach
263 265 }
264 266 }