, abcw_run_index). global $wpdb; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Uninstall cleanup of dynamically named options. $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'abcw\_run\_%' OR option_name = 'abcw_run_index'"); foreach ($abcw_hooks as $abcw_hook) { wp_unschedule_hook($abcw_hook); } // Multisite: clean each site in the network. if (is_multisite()) { $abcw_sites = get_sites(['fields' => 'ids', 'number' => 0]); foreach ($abcw_sites as $abcw_site_id) { switch_to_blog($abcw_site_id); foreach ($abcw_options as $abcw_option) { delete_option($abcw_option); } // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Uninstall cleanup of dynamically named options. $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'abcw\_run\_%' OR option_name = 'abcw_run_index'"); foreach ($abcw_hooks as $abcw_hook) { wp_unschedule_hook($abcw_hook); } restore_current_blog(); } }