woocommerce_order_shipping_to_display_shipped_via

Translators: %s: shipping method.

Description

apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', (string) $nbsp_small_class_shipped_via_sprintf_via_s_woocommerce_this_get_shipping_method_small, (unknown) $instance ); 

Parameters (2)

0. $nbsp_small_class_shipped_via_sprintf_via_s_woocommerce_this_get_shipping_method_small — Optional. (string) => ' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . ''
The nbsp small class shipped via sprintf via s woocommerce this get shipping method small.
1. $instance (unknown)
The instance.

Usage

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

Defined (1)

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

/includes/abstracts/abstract-wc-order.php  
  1. $shipping .= apply_filters( 'woocommerce_order_shipping_to_display_shipped_via', ' <small class="shipped_via">' . sprintf( __( 'via %s', 'woocommerce' ), $this->get_shipping_method() ) . '</small>', $this );