RegisterAdminMenu.php
1 month ago
RegisterRestApi.php
2 weeks ago
RegisterSiteRoutes.php
2 weeks ago
VersionUpdate.php
4 days ago
VersionUpdate.php
67 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * WordPress plugin_update action that runs the version manager. |
| 5 | * |
| 6 | * @package Framework |
| 7 | * @subpackage Wordpress\Hooks\Actions |
| 8 | * @since 1.0.0 |
| 9 | */ |
| 10 | namespace Kirki\Framework\Wordpress\Hooks\Actions; |
| 11 | |
| 12 | \defined('ABSPATH') || exit; |
| 13 | use Kirki\Framework\Wordpress\Constants\HookNames; |
| 14 | use Kirki\Framework\Wordpress\Constants\HookTypes; |
| 15 | use Kirki\Framework\Wordpress\BaseHook; |
| 16 | use Kirki\Framework\Managers\VersionUpdateManager; |
| 17 | class VersionUpdate extends BaseHook |
| 18 | { |
| 19 | /** |
| 20 | * Get the name of the hook. |
| 21 | * |
| 22 | * @return string |
| 23 | * |
| 24 | * @since 1.0.0 |
| 25 | */ |
| 26 | public function get_name() |
| 27 | { |
| 28 | return HookNames::ADMIN_INIT; |
| 29 | } |
| 30 | /** |
| 31 | * Get the type of the hook. |
| 32 | * |
| 33 | * @return string |
| 34 | * |
| 35 | * @since 1.0.0 |
| 36 | */ |
| 37 | public function get_type() |
| 38 | { |
| 39 | return HookTypes::ACTION; |
| 40 | } |
| 41 | /** |
| 42 | * Get the priority of the hook. |
| 43 | * |
| 44 | * @return int |
| 45 | * |
| 46 | * @since 1.0.0 |
| 47 | */ |
| 48 | public function get_priority() |
| 49 | { |
| 50 | return 5; |
| 51 | } |
| 52 | /** |
| 53 | * Handle the hook. |
| 54 | * |
| 55 | * @param array $args The arguments passed to the hook. |
| 56 | * |
| 57 | * @return void |
| 58 | * |
| 59 | * @since 1.0.0 |
| 60 | */ |
| 61 | public function handle(...$args) |
| 62 | { |
| 63 | $version_manager = VersionUpdateManager::get_instance(); |
| 64 | $version_manager->run(); |
| 65 | } |
| 66 | } |
| 67 |