← All changes
|
jetpack_vendor/automattic/jetpack-assets/actions.php
+14
-0
12.3.2
→
16.3
View file →
| @@ -6,10 +6,14 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // If WordPress's plugin API is available already, use it. If not, |
| 9 | 9 | // drop data into `$wp_filter` for `WP_Hook::build_preinitialized_hooks()`. |
| 10 | +// Anything hooked on plugins_loaded here must also be re-run from | |
| 11 | +// Assets::ensure_package_bootstrap(), or an older sibling copy silently skips it. JETPACK-2649. | |
| 10 | 12 | if ( function_exists( 'add_action' ) ) { |
| 11 | 13 | add_action( 'wp_default_scripts', array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ) ); |
| 14 | + add_action( 'plugins_loaded', array( Automattic\Jetpack\Assets\Script_Data::class, 'configure' ), 1 ); | |
| 15 | + add_action( 'plugins_loaded', array( Automattic\Jetpack\Assets\Shared_Stores_Assets::class, 'configure' ), 1 ); | |
| 12 | 16 | } else { |
| 13 | 17 | global $wp_filter; |
| 14 | 18 | // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 15 | 19 | $wp_filter['wp_default_scripts'][10][] = array( |
| @@ -14,6 +18,16 @@ | ||
| 14 | 18 | // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 15 | 19 | $wp_filter['wp_default_scripts'][10][] = array( |
| 16 | 20 | 'accepted_args' => 1, |
| 17 | 21 | 'function' => array( Automattic\Jetpack\Assets::class, 'wp_default_scripts_hook' ), |
| 22 | + ); | |
| 23 | + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | |
| 24 | + $wp_filter['plugins_loaded'][1][] = array( | |
| 25 | + 'accepted_args' => 0, | |
| 26 | + 'function' => array( Automattic\Jetpack\Assets\Script_Data::class, 'configure' ), | |
| 27 | + ); | |
| 28 | + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | |
| 29 | + $wp_filter['plugins_loaded'][1][] = array( | |
| 30 | + 'accepted_args' => 0, | |
| 31 | + 'function' => array( Automattic\Jetpack\Assets\Shared_Stores_Assets::class, 'configure' ), | |
| 18 | 32 | ); |
| 19 | 33 | } |