Automattic\WooCommerce\Blocks\BlockTypes
MiniCart::initialize
Initialize this block type.
- Hook into WP lifecycle.
- Register the block with WordPress.
Метод класса: MiniCart{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->initialize();
Код MiniCart::initialize() MiniCart::initialize WC 10.3.4
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, 'print_lazy_load_scripts' ), 2 );
add_filter( 'hooked_block_woocommerce/mini-cart', array( $this, 'modify_hooked_block_attributes' ), 10, 5 );
add_filter( 'hooked_block_types', array( $this, 'register_hooked_block' ), 9, 4 );
// Priority 20 ensures this runs after WooCommerce block registration (priority 10)
// allowing us to modify the block supports in the registry after registration is complete.
add_action( 'init', array( $this, 'enable_interactivity_support' ), 20 );
}