Automattic\WooCommerce\Internal\EmailEditor

Integration::extend_post_api │ public │ WC 1.0

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

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

Хуков нет.

Возвращает

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

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

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

Код Integration::extend_post_api() WC 11.2.1

public function extend_post_api(): void {
	register_rest_field(
		self::EMAIL_POST_TYPE,
		'woocommerce_data',
		array(
			'get_callback'    => array( $this->email_api_controller, 'get_email_data' ),
			'update_callback' => array( $this->email_api_controller, 'save_email_data' ),
			'schema'          => $this->email_api_controller->get_email_data_schema(),
		)
	);
}