Yoast\WP\SEO\Abilities\Infrastructure

Term_Identifier_Resolver::invalid_identifier │ private │ Yoast 1.0

Builds the error for an identifier that does not resolve to a term.

Coded yoast_seo_invalid_<field> so a caller knows which identifier to correct and retry.

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

Хуков нет.

Возвращает

WP_Error. The error for the unresolvable identifier.

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

// private - только в коде основоного (родительского) класса
$result = $this->invalid_identifier( $field ): WP_Error;
$field(строка) (обязательный)
The identifier that failed to resolve: 'term_id' or 'permalink'.

Код Term_Identifier_Resolver::invalid_identifier() Yoast 28.9

private function invalid_identifier( string $field ): WP_Error {
	return new WP_Error(
		'yoast_seo_invalid_' . $field,
		\__( 'No term could be found for the given identifier.', 'wordpress-seo' ),
		[ 'status' => 404 ],
	);
}