Yoast\WP\SEO\Config

Migration_Status::get_migration_status()protectedYoast 1.0

Retrieves the migration option.

Метод класса: Migration_Status{}

Хуков нет.

Возвращает

true|false|Массив. The status of the migration, false if no status exists.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_migration_status( $name );
$name(строка) (обязательный)
The name of the migration.

Код Migration_Status::get_migration_status() Yoast 24.0

protected function get_migration_status( $name ) {
	$current_blog_id = \get_current_blog_id();
	if ( ! isset( $this->migration_options[ $current_blog_id ][ $name ] ) ) {
		$migration_status = \get_option( self::MIGRATION_OPTION_KEY . $name );

		if ( ! \is_array( $migration_status ) || ! isset( $migration_status['version'] ) ) {
			$migration_status = [ 'version' => '0.0' ];
		}

		if ( ! isset( $this->migration_options[ $current_blog_id ] ) ) {
			$this->migration_options[ $current_blog_id ] = [];
		}
		$this->migration_options[ $current_blog_id ][ $name ] = $migration_status;
	}

	return $this->migration_options[ $current_blog_id ][ $name ];
}