Yoast\WP\SEO\Abilities\Infrastructure

Global_Setting_Field_Map::get_default_fields │ protected │ Yoast 1.0

Returns the global setting fields of Yoast SEO.

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

Хуков нет.

Возвращает

array<string,. array<string, mixed>> The JSON schema of each field, along with its option patterns, keyed by field name.

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

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

Код Global_Setting_Field_Map::get_default_fields() Yoast 28.9

protected function get_default_fields(): array {
	return [
		'seo_title'        => [
			'type'            => 'string',
			'description'     => \sprintf(
				/* translators: %s: the format of a snippet variable. */
				\__( 'The SEO title template. It can contain snippet variables in the %s format, which are replaced with the values of the page it is shown on. When empty, the default title is used.', 'wordpress-seo' ),
				'%%variable%%',
			),
			'option_patterns' => [
				Homepage_Target::NAME          => 'title-home-wpseo',
				Author_Archives_Target::NAME   => 'title-author-wpseo',
				Date_Archives_Target::NAME     => 'title-archive-wpseo',
				Search_Page_Target::NAME       => 'title-search-wpseo',
				Not_Found_Page_Target::NAME    => 'title-404-wpseo',
				Post_Type_Archive_Target::NAME => 'title-ptarchive-%s',
			],
		],
		'meta_description' => [
			'type'            => 'string',
			'description'     => \sprintf(
				/* translators: %s: the format of a snippet variable. */
				\__( 'The meta description template, shown below the title in search results. It can contain snippet variables in the %s format, which are replaced with the values of the page it is shown on. When empty, no meta description is output.', 'wordpress-seo' ),
				'%%variable%%',
			),
			'option_patterns' => [
				Homepage_Target::NAME          => 'metadesc-home-wpseo',
				Author_Archives_Target::NAME   => 'metadesc-author-wpseo',
				Date_Archives_Target::NAME     => 'metadesc-archive-wpseo',
				Post_Type_Archive_Target::NAME => 'metadesc-ptarchive-%s',
			],
		],
		'noindex'          => [
			'type'            => 'boolean',
			'description'     => \__( 'Whether search engines are told not to index these pages. true hides them from search results; false lets them be shown in search results.', 'wordpress-seo' ),
			'option_patterns' => [
				Author_Archives_Target::NAME   => 'noindex-author-wpseo',
				Date_Archives_Target::NAME     => 'noindex-archive-wpseo',
				Post_Type_Archive_Target::NAME => 'noindex-ptarchive-%s',
			],
		],
	];
}