woocommerce_blocks_(registry_identifier)_registration хук-событиеWC 4.6.0

Fires when the IntegrationRegistry is initialized.

Runs before integrations are initialized allowing new integration to be registered for use. This should be used as the primary hook for integrations to include their scripts, styles, and other code extending the blocks.

Использование

add_action( 'woocommerce_blocks_(registry_identifier)_registration', 'wp_kama_woocommerce_blocks_registry_identifier_registration_action' );

/**
 * Function for `woocommerce_blocks_(registry_identifier)_registration` action-hook.
 * 
 * @param IntegrationRegistry $that Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method.
 *
 * @return void
 */
function wp_kama_woocommerce_blocks_registry_identifier_registration_action( $that ){

	// action...
}
$that(IntegrationRegistry)
Instance of the IntegrationRegistry class which exposes the IntegrationRegistry::register() method.

Список изменений

С версии 4.6.0 Введена.

Где вызывается хук

IntegrationRegistry::initialize()
woocommerce_blocks_(registry_identifier)_registration
woocommerce/src/Blocks/Integrations/IntegrationRegistry.php 50
do_action( 'woocommerce_blocks_' . $this->registry_identifier . '_registration', $this );

Где используется хук в WooCommerce

woocommerce/src/Blocks/Payments/Api.php 50
add_action( 'woocommerce_blocks_payment_method_type_registration', array( $this, 'register_payment_method_integrations' ) );