Yoast\WP\SEO\Repositories

Indexable_Repository::find_all_with_type_and_sub_type()publicYoast 1.0

Retrieves all the indexable instances of a certain object subtype.

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

Хуков нет.

Возвращает

Indexable[]. The array with all the indexable instances of a certain object subtype.

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

$Indexable_Repository = new Indexable_Repository();
$Indexable_Repository->find_all_with_type_and_sub_type( $object_type, $object_sub_type );
$object_type(строка) (обязательный)
The object type.
$object_sub_type(строка) (обязательный)
The object subtype.

Код Indexable_Repository::find_all_with_type_and_sub_type() Yoast 23.7

public function find_all_with_type_and_sub_type( $object_type, $object_sub_type ) {
	/**
	 * The array with all the indexable instances of a certain object type and subtype.
	 *
	 * @var Indexable[] $indexables
	 */
	$indexables = $this
		->query()
		->where( 'object_type', $object_type )
		->where( 'object_sub_type', $object_sub_type )
		->find_many();

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