Yoast\WP\SEO\Abilities\User_Interface

Abilities_Integration::register_update_post_seo_data_abilityprivateYoast 1.0

Registers the update post SEO data ability.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

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

Код Abilities_Integration::register_update_post_seo_data_ability() Yoast 28.3

private function register_update_post_seo_data_ability(): void {
	\wp_register_ability(
		Ability_Categories_Integration::CATEGORY_SLUG . '/update-post-seo-data',
		$this->get_shared_ability_args(
			[
				'label'               => \__( 'Update Post SEO Data', 'wordpress-seo' ),
				'description'         => \__( 'Update the SEO data for a single post. Identify the post by post_id or by permalink (URL). Only the fields you provide are changed; a provided empty value clears that field. Only posts the current user is allowed to edit can be updated.', 'wordpress-seo' ),
				'input_schema'        => $this->get_update_post_seo_data_input_schema(),
				'output_schema'       => $this->get_post_seo_data_output_schema(),
				'permission_callback' => [ $this, 'can_edit_advanced_metadata' ],
				'execute_callback'    => [ $this->post_seo_data_updater, 'update_post_seo_data' ],
				'meta'                => [
					'show_in_rest' => true,
					'annotations'  => [
						'readonly'    => false,
						'destructive' => false,
						'idempotent'  => true,
					],
					'mcp'          => [
						'public' => true,
					],
				],
			],
		),
	);
}