Automattic\WooCommerce\Internal\EmailEditor

Integration::extend_template_post_api │ public │ WC 1.0

Extend the post API for the wp_template post type to add and save the woocommerce_data field.

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

Хуков нет.

Возвращает

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

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

$Integration = new Integration();
$Integration->extend_template_post_api(): void;

Код Integration::extend_template_post_api() WC 11.3.0

public function extend_template_post_api(): void {
	register_rest_field(
		'wp_template',
		'woocommerce_data',
		array(
			'get_callback'    => array( $this->template_api_controller, 'get_template_data' ),
			'update_callback' => array( $this->template_api_controller, 'save_template_data' ),
			'schema'          => $this->template_api_controller->get_template_data_schema(),
		)
	);
}