Yoast\WP\SEO\Abilities\User_Interface

Abilities_Integration::get_update_post_seo_data_input_schemaprivateYoast 1.0

Returns the input schema for updating a post's SEO data (write path).

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

Хуков нет.

Возвращает

Массив<Строку,. mixed> The input schema.

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

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

Код Abilities_Integration::get_update_post_seo_data_input_schema() Yoast 28.2

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

	return [
		'type'                 => 'object',
		'additionalProperties' => false,
		'properties'           => [
			'post_id'                => [
				'type'        => 'integer',
				'description' => \__( 'The ID of the post to update.', 'wordpress-seo' ),
				'minimum'     => 1,
			],
			'permalink'              => [
				'type'        => 'string',
				'description' => \__( 'The permalink (URL) of the post to update.', 'wordpress-seo' ),
			],
			'seo_title'              => $nullable_string,
			'meta_description'       => $nullable_string,
			'focus_keyphrase'        => \array_merge( $nullable_string, [ 'maxLength' => 191 ] ),
			'canonical'              => $nullable_string,
			'is_cornerstone'         => [ 'type' => 'boolean' ],
			'noindex'                => [
				'type'        => [ 'boolean', 'null' ],
				'description' => \__( 'Whether search engines should be told not to index this post. true sets noindex (the post is excluded from search results); false forces the post to be indexed; null clears the setting and falls back to the post-type default.', 'wordpress-seo' ),
			],
			'nofollow'               => [ 'type' => 'boolean' ],
			'noimageindex'           => [ 'type' => 'boolean' ],
			'noarchive'              => [ 'type' => 'boolean' ],
			'nosnippet'              => [ 'type' => 'boolean' ],
			'open_graph_title'       => $nullable_string,
			'open_graph_description' => $nullable_string,
			'twitter_title'          => $nullable_string,
			'twitter_description'    => $nullable_string,
			'schema_page_type'       => $this->nullable_enum_schema(
				\array_keys( Schema_Types::PAGE_TYPES ),
				\__( 'The Schema.org page type for the post. Must be one of the supported page types. Use null to clear it and fall back to the default.', 'wordpress-seo' ),
			),
			'schema_article_type'    => $this->nullable_enum_schema(
				$this->get_schema_article_types(),
				\__( 'The Schema.org article type for the post. Must be one of the supported article types. Use null to clear it and fall back to the default.', 'wordpress-seo' ),
			),
		],
	];
}