Migration_Status::is_version()publicYoast 1.0

Checks whether or not the given migration is at least the given version, defaults to checking for the latest version.

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

Хуков нет.


true|false. Whether or not the requested migration is at least the requested version.


$Migration_Status = new Migration_Status();
$Migration_Status->is_version( $name, $version );
$name(строка) (обязательный)
The name of the migration.
The version to check.
По умолчанию: latest version

Код Migration_Status::is_version() Yoast 21.6

public function is_version( $name, $version = \WPSEO_VERSION ) {
	$migration_status = $this->get_migration_status( $name );

	return \version_compare( $version, $migration_status['version'], '<=' );