Yoast\WP\SEO\Repositories

Indexable_Hierarchy_Repository::clear_ancestors │ public │ Yoast 1.0

Removes all ancestors for an indexable.

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

Хуков нет.

Возвращает

bool. 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 28.9

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