actions.php
20 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Action Hooks for Jetpack Publicize module. |
| 4 | * |
| 5 | * @package automattic/jetpack-publicize |
| 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( 'plugins_loaded', array( Automattic\Jetpack\Publicize\Publicize_Setup::class, 'pre_initialization' ), 1 ); |
| 12 | } else { |
| 13 | global $wp_filter; |
| 14 | // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited |
| 15 | $wp_filter['plugins_loaded'][1][] = array( |
| 16 | 'accepted_args' => 0, |
| 17 | 'function' => array( Automattic\Jetpack\Publicize\Publicize_Setup::class, 'pre_initialization' ), |
| 18 | ); |
| 19 | } |
| 20 |