WPSEO_Upgrade::finish_up
Runs the needed cleanup after an update, setting the DB version to latest version, flushing caches etc.
Метод класса: WPSEO_Upgrade{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->finish_up( $previous_version );
- $previous_version(строка|null)
- The previous version.
По умолчанию:null
Код WPSEO_Upgrade::finish_up() WPSEO Upgrade::finish up Yoast 27.6
protected function finish_up( $previous_version = null ) {
if ( $previous_version ) {
WPSEO_Options::set( 'previous_version', $previous_version, 'wpseo' );
// Store timestamp when plugin is updated from a previous version.
WPSEO_Options::set( 'last_updated_on', time(), 'wpseo' );
}
WPSEO_Options::set( 'version', WPSEO_VERSION, 'wpseo' );
// Just flush rewrites, always, to at least make them work after an upgrade.
add_action( 'shutdown', 'flush_rewrite_rules' );
// Flush the sitemap cache.
WPSEO_Sitemaps_Cache::clear();
// Make sure all our options always exist - issue #1245.
WPSEO_Options::ensure_options_exist();
}