Update WC shipping settings so no shipping zones banner appears when all are deactivated

This commit is contained in:
Albert Juhé Lluveras 2020-05-15 11:29:29 +02:00
parent 973e50ab64
commit 9a34c4fe75
2 changed files with 2 additions and 2 deletions

View File

@ -286,7 +286,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
* Show zones
*/
protected function zones_screen() {
$method_count = wc_get_shipping_method_count();
$method_count = wc_get_shipping_method_count( false, true );
wp_localize_script(
'wc-shipping-zones',

View File

@ -1495,7 +1495,7 @@ function wc_postcode_location_matcher( $postcode, $objects, $object_id_key, $obj
* @param bool $include_legacy Count legacy shipping methods too.
* @param bool $enabled_only Whether non-legacy shipping methods should be
* restricted to enabled ones. It doesn't affect
* legacy shipping methods. @since 4.2.0.
* legacy shipping methods. @since 4.3.0.
* @return int
*/
function wc_get_shipping_method_count( $include_legacy = false, $enabled_only = false ) {