exists() ) { switch_theme( $previous ); return; } foreach ( array( 'twentytwentyfour', 'twentytwentythree', 'twentytwentytwo', 'twentytwentyone' ) as $fallback ) { if ( wp_get_theme( $fallback )->exists() ) { switch_theme( $fallback ); return; } } } /** * Unschedules all plugin-owned WP-Cron hooks. */ private static function clear_scheduled_events(): void { $hooks = array( 'arshid6social_daily_digest', 'arshid6social_weekly_digest', 'arshid6social_cleanup_transients', ); foreach ( $hooks as $hook ) { $timestamp = wp_next_scheduled( $hook ); if ( $timestamp ) { wp_unschedule_event( $timestamp, $hook ); } } } }