woocommerce_use_old_di_container filter-hookWC 9.5.0

Hook to decide if the old ExtendedContainer class (instead of RuntimeContainer) should be used as the underlying WooCommerce dependency injection container.

NOTE: This hook will be removed in WooCommerce 9.5.

Usage

add_filter( 'woocommerce_use_old_di_container', 'wp_kama_woocommerce_use_old_di_container_filter' );

/**
 * Function for `woocommerce_use_old_di_container` filter-hook.
 * 
 * @param bool $should_use Value of the WOOCOMMERCE_USE_OLD_DI_CONTAINER constant, false if the constant doesn't exist.
 *
 * @return bool
 */
function wp_kama_woocommerce_use_old_di_container_filter( $should_use ){

	// filter...
	return $should_use;
}
$should_use(true|false)
Value of the WOOCOMMERCE_USE_OLD_DI_CONTAINER constant, false if the constant doesn't exist.

Changelog

Since 9.5.0 Introduced.

Where the hook is called

RuntimeContainer::should_use()
woocommerce_use_old_di_container
woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php 223
return apply_filters( 'woocommerce_use_old_di_container', $should_use );

Where the hook is used in WooCommerce

Usage not found.