← All changes
|
jetpack_vendor/automattic/jetpack-connection/actions.php
+23
-0
16.2-beta
→
16.3
View file →
| @@ -1,0 +1,23 @@ | ||
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Action Hooks for Jetpack connection assets. | |
| 4 | + * | |
| 5 | + * @package automattic/jetpack-connection | |
| 6 | + */ | |
| 7 | + | |
| 8 | +// If WordPress's plugin API is available already, use it. If not, | |
| 9 | +// drop data into `$wp_filter` for `WP_Hook::build_preinitialized_hooks()`. | |
| 10 | +if ( function_exists( 'add_action' ) ) { | |
| 11 | + add_action( | |
| 12 | + 'plugins_loaded', | |
| 13 | + array( Automattic\Jetpack\Connection\Connection_Assets::class, 'configure' ), | |
| 14 | + 1 | |
| 15 | + ); | |
| 16 | +} else { | |
| 17 | + global $wp_filter; | |
| 18 | + // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited | |
| 19 | + $wp_filter['plugins_loaded'][1][] = array( | |
| 20 | + 'accepted_args' => 0, | |
| 21 | + 'function' => array( Automattic\Jetpack\Connection\Connection_Assets::class, 'configure' ), | |
| 22 | + ); | |
| 23 | +} | |