Yoast\WP\SEO\Repositories

Indexable_Hierarchy_Repository::clear_ancestors()publicYoast 1.0

Removes all ancestors for an indexable.

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

Хуков нет.

Возвращает

true|false. Whether or not the indexables were successfully deleted.

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

$Indexable_Hierarchy_Repository = new Indexable_Hierarchy_Repository();
$Indexable_Hierarchy_Repository->clear_ancestors( $indexable_id );
$indexable_id(int) (обязательный)
The indexable id.

Код Indexable_Hierarchy_Repository::clear_ancestors() Yoast 22.4

public function clear_ancestors( $indexable_id ) {
	return $this->query()->where( 'indexable_id', $indexable_id )->delete_many();
}