WPSEO_Upgrade::finish_up()protectedYoast 1.0

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() Yoast 22.4

protected function finish_up( $previous_version = null ) {
	if ( $previous_version ) {
		WPSEO_Options::set( 'previous_version', $previous_version );
	}
	WPSEO_Options::set( 'version', WPSEO_VERSION );

	// 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();
}