Automattic\WooCommerce\EmailEditor\Engine
Email_Editor::extend_email_post_api
Extends the email post types with email specific data.
Метод класса: Email_Editor{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$Email_Editor = new Email_Editor(); $Email_Editor->extend_email_post_api();
Код Email_Editor::extend_email_post_api() Email Editor::extend email post api WC 11.3.0
public function extend_email_post_api() {
$email_post_types = array_column( self::get_post_types(), 'name' );
register_rest_field(
$email_post_types,
'email_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(),
)
);
}