| 1 |
<?php |
| 2 |
/** |
| 3 |
* Action Hooks for the Jetpack licensing package. |
| 4 |
* |
| 5 |
* @package automattic/jetpack-licensing |
| 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\Licensing::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\Licensing::class, 'configure' ), |
| 22 |
); |
| 23 |
} |
| 24 |
|