'ids', 'number' => 0, ) ) as $site_id ) { switch_to_blog( (int) $site_id ); self::run_for_site(); restore_current_blog(); } return; } self::run_for_site(); } /** * Cleans up the current site. */ private static function run_for_site(): void { global $wpdb; Feed_Scheduler::unschedule(); // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Bulk cleanup of transient rows, which core offers no API for. $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s", $wpdb->esc_like( '_transient_' . Feed_Cache::PREFIX ) . '%', $wpdb->esc_like( '_transient_timeout_' . Feed_Cache::PREFIX ) . '%' ) ); // phpcs:enable delete_option( Feed_Lock::OPTION ); delete_option( Activator::VERSION_OPTION ); delete_option( \PulseCast\Frontend\Display_Route::FLUSH_OPTION ); } }