Yoast\WP\SEO\Surfaces

Meta_Surface::for_indexables()publicYoast 1.0

Returns the meta for an indexable.

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

Хуков нет.

Возвращает

Meta|false. The meta values. False if none could be found.

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

$Meta_Surface = new Meta_Surface();
$Meta_Surface->for_indexables( $indexables, $page_type );
$indexables(Indexable[]) (обязательный)
The indexables.
$page_type(строка|null)
The page type if already known.
По умолчанию: null

Код Meta_Surface::for_indexables() Yoast 22.1

public function for_indexables( $indexables, $page_type = null ) {
	$closure = function ( $indexable ) use ( $page_type ) {
		$this_page_type = $page_type;
		if ( \is_null( $this_page_type ) ) {
			$this_page_type = $this->indexable_helper->get_page_type_for_indexable( $indexable );
		}

		return $this->build_meta( $this->context_memoizer->get( $indexable, $this_page_type ) );
	};

	return \array_map( $closure, $indexables );
}