• Resolved zinwai

    (@zinwai)


    How I remove some cities from the list? I found the solution code like this:

    add_filter( 'csz_cities', 'csz_remove_cities' );
    function csz_remove_cities( $cities ) {
             $country_code = 'EE'; 
             $unnecessary_cities = [ 'EE784', 'EE296', 'EE446' ]; 
             foreach ( $unnecessary_cities as $city ) { 
                      if ( isset( $cities[ $country_code ][ $city ] ) ) {
                          unset( $cities[ $country_code ][ $city ] ); 
                      } 
             } 
             return $cities;
     }

    In this code, the country code ‘EE’ is for Estonia and ‘EE784’, ‘EE296’, ‘EE446’ are the cities code of Estonia. But I can’t test it because I don’t know how to check the country code.

    I would know how can I find the country code for Myanmar and cities code?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘remove some cities from the list’ is closed to new replies.