Yoast\WP\SEO\Services\Indexables

Indexable_Version_Manager::indexable_needs_upgrade()publicYoast 1.0

Determines if an Indexable has a lower version than the builder for that Indexable's type.

{} Это метод класса: Indexable_Version_Manager{}

Хуков нет.

Возвращает

true|false. True if the given version is older than the current latest version.

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

$Indexable_Version_Manager = new Indexable_Version_Manager();
$Indexable_Version_Manager->indexable_needs_upgrade( $indexable );
$indexable(Indexable) (обязательный)
The Indexable to check.

Код Indexable_Version_Manager::indexable_needs_upgrade() Yoast 19.7.1

public function indexable_needs_upgrade( $indexable ) {
	if ( ( ! $indexable )
		|| ( ! \is_a( $indexable, Indexable::class ) )
	) {
		return false;
	}

	return $this->needs_upgrade( $indexable->object_type, $indexable->version );
}