Yoast\WP\SEO\Abilities\User_Interface\Abilities

Abstract_Archive_And_Special_Page_SEO_Settings_Ability::get_target_output_schema │ protected │ Yoast 1.0

Returns the output schema of the global settings of a single target.

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

Хуков нет.

Возвращает

array<string, mixed>. The output schema.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_target_output_schema(): array;

Код Abstract_Archive_And_Special_Page_SEO_Settings_Ability::get_target_output_schema() Yoast 28.9

protected function get_target_output_schema(): array {
	return [
		'type'       => 'object',
		'properties' => \array_merge(
			[
				'target'    => [
					'type'        => 'string',
					'enum'        => $this->target_repository->get_names(),
					'description' => \__( 'The pages these settings belong to.', 'wordpress-seo' ),
				],
				'post_type' => [
					'type'        => 'string',
					'description' => \sprintf(
						/* translators: %s expands to the name of a target. */
						\__( 'Only present for the %s target: the post type of the content type.', 'wordpress-seo' ),
						Post_Type_Archive_Target::NAME,
					),
				],
				'label'     => [
					'type'        => 'string',
					'description' => \sprintf(
						/* translators: %s expands to the name of a target. */
						\__( 'Only present for the %s target: the name of the content type.', 'wordpress-seo' ),
						Post_Type_Archive_Target::NAME,
					),
				],
			],
			\array_map( [ $this, 'to_output_schema' ], $this->field_map->get_fields() ),
			[
				'enabled' => [
					'type'        => 'boolean',
					'description' => \__( 'Whether these pages are in use on the site. Read-only: it can only be changed in the Yoast SEO settings. The settings of disabled pages can still be changed, but have no effect until they are enabled.', 'wordpress-seo' ),
				],
				'shared'  => [
					'type'        => 'boolean',
					'description' => \__( 'Whether these settings are shared by many pages, like all author archives. Shared settings apply to every one of those pages, so their templates must not contain text about one specific page; use snippet variables for what differs between them.', 'wordpress-seo' ),
				],
			],
		),
	];
}