Automattic\WooCommerce\Admin\Features\ProductBlockEditor
Init::register_product_templates()
Register product templates.
Method of the class: Init{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$Init = new Init(); $Init->register_product_templates();
Init::register_product_templates() Init::register product templates code WC 9.7.1
public function register_product_templates() { /** * Allows for new product template registration. * * @since 8.5.0 */ $this->product_templates = apply_filters( 'woocommerce_product_editor_product_templates', $this->get_default_product_templates() ); $this->product_templates = $this->create_default_product_template_by_custom_product_type( $this->product_templates ); usort( $this->product_templates, function ( $a, $b ) { return $a->get_order() - $b->get_order(); } ); $this->redirection_controller->set_product_templates( $this->product_templates ); // PFT: Initialize the product form controller. if ( Features::is_enabled( 'product-editor-template-system' ) ) { $product_form_controller = new ProductFormsController(); $product_form_controller->init(); } }