Yoast\WP\SEO\Abilities\User_Interface

SEO_Data_Output_Schema::get_term_output_schema │ public │ Yoast 1.0

Returns the output schema describing a term's SEO data.

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

Хуков нет.

Возвращает

array<string, mixed>. The output schema.

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

$SEO_Data_Output_Schema = new SEO_Data_Output_Schema();
$SEO_Data_Output_Schema->get_term_output_schema(): array;

Код SEO_Data_Output_Schema::get_term_output_schema() Yoast 28.9

public function get_term_output_schema(): array {
	$nullable_string = [
		'type' => [ 'string', 'null' ],
	];

	return [
		'type'       => 'object',
		'properties' => \array_merge(
			[
				'term_id'   => [ 'type' => 'integer' ],
				'term_name' => $nullable_string,
				'permalink' => $nullable_string,
				'taxonomy'  => [ 'type' => 'string' ],
			],
			$this->get_shared_properties(),
			[
				'canonical'          => [
					'type'        => [ 'string', 'null' ],
					'description' => \__( 'The custom canonical URL as stored for the term. Null when no custom value is set; the rendered companion field carries what is actually output.', 'wordpress-seo' ),
				],
				'canonical_rendered' => [
					'type'        => [ 'string', 'null' ],
					'description' => \__( 'The canonical URL as output on the front end: the custom value when set, otherwise the permalink of the term. Null when nothing is output.', 'wordpress-seo' ),
				],
				'noindex'            => [
					'type'        => [ 'boolean', 'null' ],
					'description' => \__( 'Whether search engines are told not to index this term archive. true means noindex (the archive is excluded from search results); false means the archive is forced to be indexed; null means no setting is stored and the taxonomy default applies.', 'wordpress-seo' ),
				],
			],
		),
	];
}