=') && version_compare(get_bloginfo('version'), ZADEX_MIN_WP, '>='); } /** Shown only on the Plugins screen (where the plugin can be deactivated), to users who manage plugins. */ function zadex_requirements_notice(): void { $screen = function_exists('get_current_screen') ? get_current_screen() : null; if (!is_object($screen) || !isset($screen->id) || $screen->id !== 'plugins' || !current_user_can('activate_plugins')) { return; } echo '

' . esc_html(sprintf( /* translators: 1: PHP version 2: WP version */ __('Zadex requires PHP %1$s+ and WordPress %2$s+.', 'zadex'), ZADEX_MIN_PHP, ZADEX_MIN_WP )) . '

'; } if (!zadex_requirements_met()) { add_action('admin_notices', 'zadex_requirements_notice'); return; } /** * Global accessor. */ function zadex(): \Zadex\Plugin { return \Zadex\Plugin::instance(); } register_activation_hook(__FILE__, ['\\Zadex\\Plugin', 'activate']); register_deactivation_hook(__FILE__, ['\\Zadex\\Plugin', 'deactivate']); add_action('plugins_loaded', static function (): void { zadex()->boot(); });