woocommerce_blocks_(registry_identifier)_registration хук-событиеWC 1.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.

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

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

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

woocommerce/packages/woocommerce-blocks/src/Payments/Api.php 51
add_action( 'woocommerce_blocks_payment_method_type_registration', array( $this, 'register_payment_method_integrations' ) );