WPSEO_Upgrade::upgrade_90
Performs the 9.0 upgrade.
Метод класса: WPSEO_Upgrade{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->upgrade_90();
Код WPSEO_Upgrade::upgrade_90() WPSEO Upgrade::upgrade 90 Yoast 27.8
protected function upgrade_90() {
global $wpdb;
// Invalidate all sitemap cache transients.
WPSEO_Sitemaps_Cache_Validator::cleanup_database();
// Removes all scheduled tasks for hitting the sitemap index.
wp_clear_scheduled_hook( 'wpseo_hit_sitemap_index' );
// phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: No relevant caches.
// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery -- Reason: Most performant way.
$wpdb->query(
$wpdb->prepare(
'DELETE FROM %i
WHERE %i LIKE %s',
[ $wpdb->options, 'option_name', 'wpseo_sitemap_%' ],
),
);
}