WC_Shipping_Zones::get_shadowing_zone
Get the first higher-priority zone that fully covers a zone.
Method of the class: WC_Shipping_Zones{}
No Hooks.
Returns
array|null. Shadowing zone, or null when none exists.
Usage
$result = WC_Shipping_Zones::get_shadowing_zone( $zone, $higher_priority_zones );
- $zone(array) (required)
- Zone to check.
- $higher_priority_zones(array) (required)
- Higher-priority zones.
Changelog
| Since 11.1.0 | Introduced. |
WC_Shipping_Zones::get_shadowing_zone() WC Shipping Zones::get shadowing zone code WC 11.1.2
private static function get_shadowing_zone( $zone, $higher_priority_zones ) {
foreach ( $higher_priority_zones as $higher_priority_zone ) {
if ( self::zone_covers_zone( $higher_priority_zone, $zone ) ) {
return $higher_priority_zone;
}
}
return null;
}