WC_Shipping_Zones::get_shadowing_zone
Get the first higher-priority zone that fully covers a zone.
Метод класса: WC_Shipping_Zones{}
Хуков нет.
Возвращает
array|null. Shadowing zone, or null when none exists.
Использование
$result = WC_Shipping_Zones::get_shadowing_zone( $zone, $higher_priority_zones );
- $zone(массив) (обязательный)
- Zone to check.
- $higher_priority_zones(массив) (обязательный)
- Higher-priority zones.
Список изменений
| С версии 11.1.0 | Введена. |
Код WC_Shipping_Zones::get_shadowing_zone() WC Shipping Zones::get shadowing zone WC 11.2.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;
}