woocommerce_shipping_<id>_is_available

The WooCommerce woocommerce shipping id is available hook.

Description

apply_filters( 'woocommerce_shipping_<id>_is_available', (unknown) $is_available, (unknown) $package ); 

Parameters (2)

0. $is_available (unknown)
The is available.
1. $package (unknown)
The package.

Usage

To run the hook, copy the example below.
  1. $is_available = apply_filters( 'woocommerce_shipping_{$id}_is_available', $is_available, $package ); 
  2.  
  3. if ( !empty( $is_available ) ) { 
  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_<id>_is_available callback 
  2. function filter_woocommerce_shipping_id_is_available( $is_available, $package ) { 
  3. // make filter magic happen here... 
  4. return $is_available
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "woocommerce_shipping_{$id}_is_available", 'filter_woocommerce_shipping_id_is_available', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "woocommerce_shipping_{$id}_is_available", 'filter_woocommerce_shipping_id_is_available', 10, 2 ); 

Defined (5)

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

/includes/shipping/legacy-local-pickup/class-wc-shipping-legacy-local-pickup.php  
  1. return apply_filters( 'woocommerce_shipping_' . $this->id . '_is_available', $is_available, $package ); 
/includes/shipping/legacy-international-delivery/class-wc-shipping-legacy-international-delivery.php  
  1. return apply_filters( 'woocommerce_shipping_' . $this->id . '_is_available', true, $package ); 
/includes/shipping/legacy-free-shipping/class-wc-shipping-legacy-free-shipping.php  
  1. return apply_filters( 'woocommerce_shipping_' . $this->id . '_is_available', $is_available, $package ); 
/includes/shipping/free-shipping/class-wc-shipping-free-shipping.php  
  1. return apply_filters( 'woocommerce_shipping_' . $this->id . '_is_available', $is_available, $package ); 
/includes/abstracts/abstract-wc-shipping-method.php  
  1. return apply_filters( 'woocommerce_shipping_' . $this->id . '_is_available', $available, $package );