← All changes
|
jetpack_vendor/automattic/jetpack-backup/actions.php
+21
-2
13.2.4
→
16.3-beta
View file →
| @@ -22,11 +22,30 @@ | ||
| 22 | 22 | $add_action = $add_filter; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Clean up expired Helper Scripts from a scheduled event. |
| 26 | -$add_action( 'jetpack_backup_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0003\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) ); | |
| 26 | +$add_action( 'jetpack_backup_cleanup_helper_scripts', array( 'Automattic\\Jetpack\\Backup\\V0005\\Helper_Script_Manager', 'cleanup_expired_helper_scripts' ) ); | |
| 27 | 27 | |
| 28 | 28 | // Register REST routes. |
| 29 | -$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0003\\REST_Controller', 'register_rest_routes' ) ); | |
| 29 | +$add_action( 'rest_api_init', array( 'Automattic\\Jetpack\\Backup\\V0005\\REST_Controller', 'register_rest_routes' ) ); | |
| 30 | 30 | |
| 31 | 31 | // Set up package version hook. |
| 32 | 32 | $add_filter( 'jetpack_package_versions', 'Automattic\\Jetpack\\Backup\\Package_Version::send_package_version_to_tracker' ); |
| 33 | + | |
| 34 | +// Register Jetpack Backup abilities with the WordPress Abilities API at autoload | |
| 35 | +// time so the surface is available in any consumer that loads this package | |
| 36 | +// (both the standalone Jetpack Backup plugin and the Jetpack plugin). The | |
| 37 | +// `jetpack_wp_abilities_enabled` filter (default false) gates registration, | |
| 38 | +// so this is a no-op until a site opts in. | |
| 39 | +$add_action( | |
| 40 | + 'plugins_loaded', | |
| 41 | + static function () { | |
| 42 | + if ( ! apply_filters( 'jetpack_wp_abilities_enabled', false ) ) { | |
| 43 | + return; | |
| 44 | + } | |
| 45 | + if ( ! class_exists( \Automattic\Jetpack\Backup\V0005\Abilities\Backup_Abilities::class ) ) { | |
| 46 | + return; | |
| 47 | + } | |
| 48 | + \Automattic\Jetpack\Backup\V0005\Abilities\Backup_Abilities::init(); | |
| 49 | + }, | |
| 50 | + 20 | |
| 51 | +); | |