Yoast\WP\SEO\Repositories

Indexable_Repository::find_by_ids()publicYoast 1.0

Finds the indexables by id's.

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

Хуков нет.

Возвращает

Indexable[]. The found indexables.

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

$Indexable_Repository = new Indexable_Repository();
$Indexable_Repository->find_by_ids( $indexable_ids );
$indexable_ids(массив) (обязательный)
The indexable id's.

Код Indexable_Repository::find_by_ids() Yoast 22.3

public function find_by_ids( array $indexable_ids ) {
	if ( empty( $indexable_ids ) ) {
		return [];
	}

	$indexables = $this
		->query()
		->where_in( 'id', $indexable_ids )
		->find_many();

	return \array_map( [ $this, 'upgrade_indexable' ], $indexables );
}