woocommerce_shipping_package_name

The WooCommerce woocommerce shipping package name hook.

Description

apply_filters( 'woocommerce_shipping_package_name', (unknown) $sprintf, (unknown) $i, (unknown) $package ); 

Parameters (3)

0. $sprintf (unknown) => sprintf( _nx( 'Shipping', 'Shipping %d', ( $i + 1 ), 'shipping packages', 'woocommerce' ), ( $i + 1 ) )
The sprintf.
1. $i (unknown)
The i.
2. $package (unknown)
The package.

Usage

To run the hook, copy the example below.
  1. $sprintf = apply_filters( 'woocommerce_shipping_package_name', $sprintf, $i, $package ); 
  2.  
  3. if ( !empty( $sprintf ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_shipping_package_name callback 
  2. function filter_woocommerce_shipping_package_name( $sprintf, $i, $package ) { 
  3. // make filter magic happen here... 
  4. return $sprintf
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_shipping_package_name', 'filter_woocommerce_shipping_package_name', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_shipping_package_name', 'filter_woocommerce_shipping_package_name', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/wc-cart-functions.php  
  1. 'package_name' => apply_filters( 'woocommerce_shipping_package_name', sprintf( _nx( 'Shipping', 'Shipping %d', ( $i + 1 ), 'shipping packages', 'woocommerce' ), ( $i + 1 ) ), $i, $package ),