woocommerce_shipping_package_name хук-фильтрWC 1.0

translators: %d: shipping package number

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

add_filter( 'woocommerce_shipping_package_name', 'wp_kama_woocommerce_shipping_package_name_filter', 10, 3 );

/**
 * Function for `woocommerce_shipping_package_name` filter-hook.
 * 
 * @param  $sprintf() 
 * @param  $i         
 * @param  $package   
 *
 * @return 
 */
function wp_kama_woocommerce_shipping_package_name_filter( $sprintf(), $i, $package ){

	// filter...
	return $sprintf();
}
$sprintf()
-
$i
-
$package
-

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

wc_cart_totals_shipping_html()
woocommerce_shipping_package_name
CartController::get_package_name()
woocommerce_shipping_package_name
woocommerce/includes/wc-cart-functions.php 231
'package_name'             => apply_filters( 'woocommerce_shipping_package_name', ( ( $i + 1 ) > 1 ) ? sprintf( _x( 'Shipping %d', 'shipping packages', 'woocommerce' ), ( $i + 1 ) ) : _x( 'Shipping', 'shipping packages', 'woocommerce' ), $i, $package ),
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 827-838
return apply_filters(
	'woocommerce_shipping_package_name',
	$index > 1 ?
		sprintf(
			/* translators: %d: shipping package number */
			_x( 'Shipping method %d', 'shipping packages', 'woocommerce' ),
			$index
		) :
		_x( 'Shipping method', 'shipping packages', 'woocommerce' ),
	$package['package_id'],
	$package
);

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

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