woocommerce_get_zone_criteria
Get shipping zone criteria
Usage
add_filter( 'woocommerce_get_zone_criteria', 'wp_kama_woocommerce_get_zone_criteria_filter', 10, 3 );
/**
* Function for `woocommerce_get_zone_criteria` filter-hook.
*
* @param array $criteria Get zone criteria.
* @param array $package Package information.
* @param array $postcode_locations Postcode range and wildcard matching.
*
* @return array
*/
function wp_kama_woocommerce_get_zone_criteria_filter( $criteria, $package, $postcode_locations ){
// filter...
return $criteria;
}
- $criteria(array)
- Get zone criteria.
- $package(array)
- Package information.
- $postcode_locations(array)
- Postcode range and wildcard matching.
Changelog
| Since 3.6.6 | Introduced. |
Where the hook is called
woocommerce_get_zone_criteria
woocommerce/includes/data-stores/class-wc-shipping-zone-data-store.php 341
$criteria = apply_filters( 'woocommerce_get_zone_criteria', $criteria, $package, $postcode_locations );