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.
Метод класса: Integration{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Integration = new Integration(); $Integration->extend_template_post_api(): void;
Код Integration::extend_template_post_api() 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(),
)
);
}