Automattic\WooCommerce\Internal\EmailEditor
Integration::add_email_post_type()
Add WooCommerce email post type to the list of supported post types.
Метод класса: Integration{}
Хуков нет.
Возвращает
Массив
. Modified list of post types.
Использование
$Integration = new Integration(); $Integration->add_email_post_type( $post_types ): array;
- $post_types(массив) (обязательный)
- List of post types.
Код Integration::add_email_post_type() Integration::add email post type WC 9.8.1
public function add_email_post_type( array $post_types ): array { $post_types[] = array( 'name' => self::EMAIL_POST_TYPE, 'args' => array( 'labels' => array( 'name' => __( 'Woo Emails', 'woocommerce' ), 'singular_name' => __( 'Woo Email', 'woocommerce' ), 'add_new_item' => __( 'Add New Woo Email', 'woocommerce' ), 'edit_item' => __( 'Edit Woo Email', 'woocommerce' ), 'new_item' => __( 'New Woo Email', 'woocommerce' ), 'view_item' => __( 'View Woo Email', 'woocommerce' ), 'search_items' => __( 'Search Woo Emails', 'woocommerce' ), ), 'rewrite' => array( 'slug' => self::EMAIL_POST_TYPE ), 'supports' => array( 'title', 'editor' ), 'public' => true, 'show_ui' => true, // Showing in the admin UI is temporary, it will be removed in the future. 'show_in_menu' => true, 'show_in_rest' => true, ), ); return $post_types; }