Automattic\WooCommerce\Admin\Features\ProductBlockEditor
Init::register_product_templates
Register product templates.
Метод класса: Init{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$Init = new Init(); $Init->register_product_templates();
Код Init::register_product_templates() Init::register product templates WC 10.8.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();
}
}