Automattic\WooCommerce\Internal\EmailEditor
Integration::extend_template_post_api
Extend the post API for the wp_template 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_template_post_api(): void;
Integration::extend_template_post_api() Integration::extend template post api code WC 10.3.6
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(),
)
);
}