resume_pulls = $resume_pulls ?? array( self::class, 'resume_pulls' ); } /** * Ends the pulls' pause and schedules one pull at once. */ public static function resume_pulls(): void { PullScheduler::clear_retry_at(); ( new PullScheduler() )->schedule_now(); } /** * Registers the handler. */ public function register(): void { add_action( 'admin_post_' . AdminAction::hook_name( self::ACTION ), array( $this, 'handle' ) ); } /** * Handles the button and redirects (never returns). */ public function handle(): void { AdminAction::verify( self::ACTION ); StatusService::clear(); ( $this->resume_pulls )(); wp_safe_redirect( SettingsPage::url() ); exit; } }