before_woocommerce_init
Action triggered before WooCommerce initialization begins.
Использование
add_action( 'before_woocommerce_init', 'wp_kama_before_woocommerce_init_action' );
/**
* Function for `before_woocommerce_init` action-hook.
*
* @return void
*/
function wp_kama_before_woocommerce_init_action(){
// action...
}Где вызывается хук
before_woocommerce_init
woocommerce/includes/class-woocommerce.php 876
do_action( 'before_woocommerce_init' ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment
Где используется хук в WooCommerce
woocommerce/src/Internal/Admin/Agentic/AgenticController.php 33
add_action( 'before_woocommerce_init', array( $this, 'on_init' ) );
woocommerce/src/Internal/DataStores/Orders/CustomOrdersTableController.php 150
add_action( 'before_woocommerce_init', array( $this, 'maybe_set_order_cache_group_as_non_persistent' ) );
woocommerce/src/Internal/Features/FeaturesController.php 145
add_filter( 'before_woocommerce_init', array( $this, 'register_additional_features' ), -9999, 0 );