woocommerce_use_old_di_container хук-фильтрWC 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.

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

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.

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

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

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

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 );

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

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