Automattic\WooCommerce\Blocks\BlockTypes
MiniCart::initialize()
Initialize this block type.
- Hook into WP lifecycle.
- Register the block with WordPress.
Метод класса: MiniCart{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->initialize();
Код MiniCart::initialize() MiniCart::initialize WC 7.7.2
protected function initialize() { parent::initialize(); add_action( 'wp_loaded', array( $this, 'register_empty_cart_message_block_pattern' ) ); add_action( 'wp_print_footer_scripts', array( $this, 'enqueue_wc_settings' ), 1 ); // We need this action to run after the equivalent in AssetDataRegistry. add_action( 'wp_print_footer_scripts', array( $this, 'print_lazy_load_scripts' ), 3 ); }