Yoast\WP\SEO\Abilities\Infrastructure

Term_Identifier_Resolver::by_id │ private │ Yoast 1.0

Resolves a term by its ID.

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

Хуков нет.

Возвращает

Indexable|WP_Error. The matching indexable, or a not-found error.

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

// private - только в коде основоного (родительского) класса
$result = $this->by_id( $term_id );
$term_id(int) (обязательный)
The term ID.

Код Term_Identifier_Resolver::by_id() Yoast 28.9

private function by_id( int $term_id ) {
	$indexable = $this->indexable_repository->find_by_id_and_type( $term_id, 'term', false );

	if ( ! $indexable ) {
		return $this->invalid_identifier( 'term_id' );
	}

	return $indexable;
}