Automattic\WooCommerce\Internal\EmailEditor

Integration::extend_post_apipublicWC 1.0

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

Method of the class: Integration{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

Integration::extend_post_api() code WC 10.3.6

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(),
		)
	);
}