Automattic\WooCommerce\Admin\Features\ProductBlockEditor
Init::get_default_product_templates()
Get default product templates.
Метод класса: Init{}
Хуков нет.
Возвращает
Массив
. The default templates.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_default_product_templates();
Код Init::get_default_product_templates() Init::get default product templates WC 9.7.1
private function get_default_product_templates() { $templates = array(); $templates[] = new ProductTemplate( array( 'id' => 'standard-product-template', 'title' => __( 'Standard product', 'woocommerce' ), 'description' => __( 'A single physical or virtual product, e.g. a t-shirt or an eBook.', 'woocommerce' ), 'order' => 10, 'icon' => 'shipping', 'layout_template_id' => 'simple-product', 'product_data' => array( 'type' => ProductType::SIMPLE, ), ) ); $templates[] = new ProductTemplate( array( 'id' => 'grouped-product-template', 'title' => __( 'Grouped product', 'woocommerce' ), 'description' => __( 'A set of products that go well together, e.g. camera kit.', 'woocommerce' ), 'order' => 20, 'icon' => 'group', 'layout_template_id' => 'simple-product', 'product_data' => array( 'type' => ProductType::GROUPED, ), ) ); $templates[] = new ProductTemplate( array( 'id' => 'affiliate-product-template', 'title' => __( 'Affiliate product', 'woocommerce' ), 'description' => __( 'A link to a product sold on a different website, e.g. brand collab.', 'woocommerce' ), 'order' => 30, 'icon' => 'link', 'layout_template_id' => 'simple-product', 'product_data' => array( 'type' => ProductType::EXTERNAL, ), ) ); return $templates; }