Plugin Directory

Changeset 3133754


Ignore:
Timestamp:
08/11/2024 02:58:46 PM (20 months ago)
Author:
Beee
Message:

fix database queries + remove transients

Location:
acf-city-selector
Files:
32 edited
1 copied

Legend:

Unmodified
Added
Removed
  • acf-city-selector/tags/1.14.0/ACF_City_Selector.php

    r3074624 r3133754  
    44    Plugin URI:     https://acf-city-selector.com
    55    Description:    An extension for ACF which allows you to select a city based on country and province/state.
    6     Version:        1.13.0
    7     Tested up to:   6.5.2
     6    Version:        1.14.0
     7    Tested up to:   6.6.1
    88    Requires PHP:   7.0
    99    Author:         Beee
     
    3232             */
    3333            public function __construct() {
    34 
    35                 $this->settings = array(
     34               
     35                $this->settings = [
    3636                    'db_version' => '1.0',
    3737                    'url'        => plugin_dir_url( __FILE__ ),
    38                     'version'    => '1.13.0',
    39                 );
    40 
     38                    'version'    => '1.14.0',
     39                ];
     40               
    4141                if ( ! class_exists( 'ACFCS_WEBSITE_URL' ) ) {
    4242                    define( 'ACFCS_WEBSITE_URL', 'https://acf-city-selector.com' );
     
    4747                    define( 'ACFCS_PLUGIN_PATH', $plugin_path );
    4848                }
    49 
    50                 register_activation_hook( __FILE__,             array( $this, 'acfcs_plugin_activation' ) );
    51                 register_deactivation_hook( __FILE__,           array( $this, 'acfcs_plugin_deactivation' ) );
    52 
    53                 add_action( 'acf/register_fields',                  array( $this, 'acfcs_include_field_types' ) ); // v4
    54                 add_action( 'acf/include_field_types',              array( $this, 'acfcs_include_field_types' ) ); // v5
    55 
    56                 add_action( 'admin_enqueue_scripts',                array( $this, 'acfcs_add_scripts' ) );
    57                 add_action( 'wp_enqueue_scripts',                   array( $this, 'acfcs_add_scripts' ) );
    58 
    59                 add_action( 'admin_menu',                           array( $this, 'acfcs_add_admin_pages' ) );
    60                 add_action( 'admin_init',                           array( $this, 'acfcs_admin_menu' ) );
    61                 add_action( 'admin_init',                           array( $this, 'acfcs_errors' ) );
    62                 add_action( 'admin_init',                           array( $this, 'acfcs_check_table' ) );
    63                 add_action( 'admin_notices',                        array( $this, 'acfcs_check_cities' ) );
    64                 add_action( 'init',                                 array( $this, 'acfcs_load_textdomain' ) );
    65                 add_action( 'plugins_loaded',                       array( $this, 'acfcs_change_plugin_order' ), 5 );
    66                 add_action( 'plugins_loaded',                       array( $this, 'acfcs_check_for_acf' ), 6 );
    67                 add_action( 'plugins_loaded',                       array( $this, 'acfcs_check_acf_version' ) );
    68 
    69                 add_action( 'acf/input/admin_l10n',                 array( $this, 'acfcs_error_messages' ) );
    70 
    71                 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'acfcs_settings_link' ) );
    72 
     49               
     50                register_activation_hook( __FILE__,     [ $this, 'acfcs_plugin_activation' ] );
     51                register_deactivation_hook( __FILE__,   [ $this, 'acfcs_plugin_deactivation' ] );
     52               
     53                add_action( 'acf/register_fields',      [ $this, 'acfcs_include_field_types' ] ); // v4
     54                add_action( 'acf/include_field_types',  [ $this, 'acfcs_include_field_types' ] ); // v5
     55               
     56                add_action( 'admin_enqueue_scripts',    [ $this, 'acfcs_add_scripts' ] );
     57                add_action( 'wp_enqueue_scripts',       [ $this, 'acfcs_add_scripts' ] );
     58               
     59                add_action( 'admin_menu',               [ $this, 'acfcs_add_admin_pages' ] );
     60                add_action( 'admin_init',               [ $this, 'acfcs_admin_menu' ] );
     61                add_action( 'admin_init',               [ $this, 'acfcs_errors' ] );
     62                add_action( 'admin_init',               [ $this, 'acfcs_check_table' ] );
     63                add_action( 'admin_notices',            [ $this, 'acfcs_check_cities' ] );
     64                add_action( 'init',                     [ $this, 'acfcs_load_textdomain' ] );
     65                add_action( 'plugins_loaded',           [ $this, 'acfcs_change_plugin_order' ], 5 );
     66                add_action( 'plugins_loaded',           [ $this, 'acfcs_check_for_acf' ], 6 );
     67                add_action( 'plugins_loaded',           [ $this, 'acfcs_check_acf_version' ] );
     68               
     69                add_action( 'acf/input/admin_l10n',     [ $this, 'acfcs_error_messages' ] );
     70               
     71                add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), [ $this, 'acfcs_settings_link' ] );
     72               
    7373                // functions & hooks
    7474                include 'inc/acfcs-actions.php';
     
    106106            public function acfcs_plugin_deactivation() {
    107107                delete_option( 'acfcs_db_version' );
    108                 // this hook is here because I didn't want to create a new hook for an existing action
    109                 do_action( 'acfcs_delete_transients' );
    110108                // other important stuff gets done in uninstall.php
    111109            }
     
    150148                }
    151149            }
    152 
    153 
    154             /**
    155             * Check if cities need to be re-imported
    156             *
    157             * @return void
    158             */
     150           
     151           
     152            /**
     153            * Check if cities need to be re-imported
     154            *
     155            * @return void
     156            */
    159157            public function acfcs_check_cities() {
    160                 if ( '1.7.0' < $this->settings[ 'version' ] && false == get_option( 'acfcs_city_update_1_8_0' ) ) {
    161                     $countries = [ 'nl', 'be' ];
    162                     foreach( $countries as $country_code ) {
    163                         if ( true === acfcs_has_cities( $country_code ) ) {
    164                             $reimport[] = $country_code;
    165                         }
    166                     }
    167                     if ( isset( $reimport ) ) {
    168                         $country_name = 1 === count( $reimport ) ? acfcs_get_country_name( $reimport[ 0 ] ) : false;
    169                         $notice       = sprintf( __( 'Several %s had broken ascii characters. You need to re-import these countries to get the correct city names.', 'acf-city-selector' ), _n( sprintf( __( 'cities in %s', 'acf-city-selector' ), $country_name ), __( 'cities in Belgium and Netherlands', 'acf-city-selector' ), count( $reimport ), 'acf-city-selector' ) );
    170                         echo sprintf( '<div class="notice notice-warning is-dismissible"><p>%s</p></div>', $notice );
    171                     } else {
    172                         update_option( 'acfcs_city_update_1_8_0', 'done' );
    173                     }
    174                 }
     158                if ( '1.7.0' < $this->settings[ 'version' ] && false == get_option( 'acfcs_city_update_1_8_0' ) ) {
     159                    $countries = [ 'nl', 'be' ];
     160                    foreach( $countries as $country_code ) {
     161                        if ( true === acfcs_has_cities( $country_code ) ) {
     162                            $reimport[] = $country_code;
     163                        }
     164                    }
     165                    if ( isset( $reimport ) ) {
     166                        $country_name = 1 === count( $reimport ) ? acfcs_get_country_name( $reimport[ 0 ] ) : false;
     167                        $notice       = sprintf( __( 'Several %s had broken ascii characters. You need to re-import these countries to get the correct city names.', 'acf-city-selector' ), _n( sprintf( __( 'cities in %s', 'acf-city-selector' ), $country_name ), __( 'cities in Belgium and Netherlands', 'acf-city-selector' ), count( $reimport ), 'acf-city-selector' ) );
     168                        echo sprintf( '<div class="notice notice-warning is-dismissible"><p>%s</p></div>', $notice );
     169                    } else {
     170                        update_option( 'acfcs_city_update_1_8_0', 'done' );
     171                    }
     172                }
    175173            }
    176174
     
    345343
    346344            public function acfcs_load_textdomain() {
    347                 load_plugin_textdomain( 'acf-city-selector', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     345                load_plugin_textdomain( 'acf-city-selector', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    348346            }
    349347
  • acf-city-selector/tags/1.14.0/admin/acf-city-selector-v4.php

    r2696652 r3133754  
    1313            var $settings, // will hold info such as dir / path
    1414                $defaults; // will hold default field options
    15 
    16 
    17             /*
    18             *  __construct
    19             *
    20             *  Set name / label needed for actions / filters
    21             *
    22             *  @since   3.6
    23             *  @date    23/01/13
    24             */
     15           
     16           
     17            /**
     18             * __construct
     19             *
     20             * Set name / label needed for actions / filters
     21             *
     22             * @since   3.6
     23             * @date    23/01/13
     24             *
     25             * @param $settings
     26             */
    2527            function __construct( $settings ) {
    2628
     
    4244
    4345
    44             /*
    45             *  create_options()
    46             *
    47             *  Create extra options for your field. This is rendered when editing a field.
    48             *  The value of $field['name'] can be used (like below) to save extra data to the $field
    49             *
    50             *  @type    action
    51             *  @since   3.6
    52             *  @date    23/01/13
    53             *
    54             *  @param   $field  - an array holding all the field's data
    55             */
     46            /**
     47             * create_options()
     48             *
     49             * Create extra options for your field. This is rendered when editing a field.
     50             * The value of $field['name'] can be used (like below) to save extra data to the $field
     51             *
     52             * @type    action
     53             * @since   3.6
     54             * @date    23/01/13
     55             *
     56             * @param $field
     57             *
     58             * @return void
     59             */
    5660            function create_options( $field ) {
    5761                $field = array_merge($this->defaults, $field);
     
    130134
    131135
    132             /*
    133             *  create_field()
    134             *
    135             *  Create the HTML interface for your field
    136             *
    137             *  @param   $field - an array holding all the field's data
    138             *
    139             *  @type    action
    140             *  @since   3.6
    141             *  @date    23/01/13
    142             */
     136            /**
     137             * create_field()
     138             *
     139             * Create the HTML interface for your field
     140             *
     141             * @type    action
     142             * @since   3.6
     143             * @date    23/01/13
     144             *
     145             * @param $field
     146             *
     147             * @return void
     148             */
    143149            function create_field( $field ) {
    144150                $field            = array_merge( $this->defaults, $field );
     
    197203
    198204
    199             /*
    200             *  input_admin_enqueue_scripts()
    201             *
    202             *  This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
    203             *  Use this action to add CSS + JavaScript to assist your create_field() action.
    204             *
    205             *  $info    https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
    206             *  @type    action
    207             *  @since   3.6
    208             *  @date    23/01/13
    209             *
    210             *  @TODO: DRY
    211             */
     205            /**
     206             * input_admin_enqueue_scripts()
     207             *
     208             * This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
     209             * Use this action to add CSS + JavaScript to assist your create_field() action.
     210             *
     211             * $info    https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
     212             * @type    action
     213             * @since   3.6
     214             * @date    23/01/13
     215             *
     216             * @return void
     217             *
     218             * @TODO: DRY
     219             */
    212220            function input_admin_enqueue_scripts() {
    213221
     
    265273
    266274
    267             /*
    268             * load_value()
    269             *
    270             * This filter is applied to the $value after it is loaded from the db
    271             *
    272             *  @type    filter
    273             *  @since   3.6
    274             *  @date    23/01/13
    275             *
    276             *  @param   $value - the value found in the database
    277             *  @param   $post_id - the $post_id from which the value was loaded
    278             *  @param   $field - the field array holding all the field options
    279             *
    280             *  @TODO: DRY
    281             *
    282             *  @return  $value - the value to be saved in the database
    283             */
     275            /**
     276             * load_value()
     277             *
     278             * This filter is applied to the $value after it is loaded from the db
     279             *
     280             * @type filter
     281             * @since   3.6
     282             * @date    23/01/13
     283             *
     284             * @param $value
     285             * @param $post_id
     286             * @param $field
     287             *
     288             * @return mixed
     289             *
     290             * @TODO: DRY
     291             */
    284292            function load_value( $value, $post_id, $field ) {
    285293                $state_code   = false;
     
    388396        }
    389397
    390 
    391398        // initialize
    392399        new acf_field_city_selector( $this->settings );
    393400
    394 
    395         // class_exists check
    396401    endif;
  • acf-city-selector/tags/1.14.0/admin/acf-city-selector-v5.php

    r2906374 r3133754  
    6969                    'value'        => $field[ 'show_labels' ],
    7070                ) );
    71 
    72                 acf_render_field_setting( $field, array(
     71               
     72                acf_render_field_setting( $field, array(
    7373                    'choices'      => $select_options,
    7474                    'instructions' => esc_html__( 'Use select2 for dropdowns', 'acf-city-selector' ),
     
    124124             */
    125125            function render_field( $field ) {
    126                 $default_country  = ( isset( $field[ 'default_country' ] ) && ! empty( $field[ 'default_country' ] ) ) ? $field[ 'default_country' ] : false;
    127                 $prefill_cities   = [];
    128                 $prefill_states   = [];
    129                 $selected_country = ( isset( $field[ 'value' ][ 'countryCode' ] ) ) ? $field[ 'value' ][ 'countryCode' ] : false;
    130                 $selected_state   = ( isset( $field[ 'value' ][ 'stateCode' ] ) ) ? $field[ 'value' ][ 'stateCode' ] : false;
    131                 $selected_city    = ( isset( $field[ 'value' ][ 'cityName' ] ) ) ? $field[ 'value' ][ 'cityName' ] : false;
    132                 $show_first       = true;
    133                 $store_meta       = ( isset( $field[ 'store_meta' ] ) ) ? $field[ 'store_meta' ] : false;
    134                 $which_fields     = ( isset( $field[ 'which_fields' ] ) ) ? $field[ 'which_fields' ] : 'all';
    135 
    136                 if ( false !== $default_country && false == $selected_country ) {
     126                $default_country  = ( isset( $field[ 'default_country' ] ) && ! empty( $field[ 'default_country' ] ) ) ? $field[ 'default_country' ] : false;
     127                $prefill_cities   = [];
     128                $prefill_states   = [];
     129                $selected_country = ( isset( $field[ 'value' ][ 'countryCode' ] ) ) ? $field[ 'value' ][ 'countryCode' ] : false;
     130                $selected_state   = ( isset( $field[ 'value' ][ 'stateCode' ] ) ) ? $field[ 'value' ][ 'stateCode' ] : false;
     131                $selected_city    = ( isset( $field[ 'value' ][ 'cityName' ] ) ) ? $field[ 'value' ][ 'cityName' ] : false;
     132                $show_first       = true;
     133                $store_meta       = ( isset( $field[ 'store_meta' ] ) ) ? $field[ 'store_meta' ] : false;
     134                $which_fields     = ( isset( $field[ 'which_fields' ] ) ) ? $field[ 'which_fields' ] : 'all';
     135               
     136                if ( false !== $default_country && false == $selected_country ) {
    137137                    // New post with default country
    138138                    if ( in_array( $which_fields, [ 'all', 'country_state', 'state_city' ] ) ) {
     
    176176                    echo acfcs_render_dropdown( 'city', $field, $selected_city, $prefill_values );
    177177                }
    178                 if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) && $store_meta ) {
    179                     echo acfcs_render_hidden_field( 'store_meta', '1' );
     178                if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) && $store_meta ) {
     179                    echo acfcs_render_hidden_field( 'store_meta', '1' );
    180180                }
    181181            }
     
    238238                    }
    239239                }
    240 
     240               
    241241                if ( strlen( $country_code ) == 2 && false != $state_code ) {
    242242                    global $wpdb;
    243                     $table                  = $wpdb->prefix . 'cities';
    244                     $sql_query              = $wpdb->prepare( "SELECT country, state_name FROM {$table} WHERE country_code = %s AND state_code = %s", $country_code, $state_code );
    245                     $row                    = $wpdb->get_row( $sql_query );
    246                     $value[ 'stateCode' ]   = $state_code;
    247                     $value[ 'stateName' ]   = ( isset( $row->state_name ) ) ? $row->state_name : false;
    248                     $value[ 'countryName' ] = ( isset( $row->country ) ) ? $row->country : false;
     243                    $table                  = $wpdb->prefix . 'cities';
     244                    $sql_query              = $wpdb->prepare( "SELECT country, state_name FROM {$table} WHERE country_code = %s AND state_code = %s", $country_code, $state_code );
     245                    $row                    = $wpdb->get_row( $sql_query );
     246                    $value[ 'stateCode' ]   = $state_code;
     247                    $value[ 'stateName' ]   = ( isset( $row->state_name ) ) ? $row->state_name : false;
     248                    $value[ 'countryName' ] = ( isset( $row->country ) ) ? $row->country : false;
    249249                }
    250250
     
    325325                    }
    326326                }
    327 
    328                 if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) ) {
    329                     do_action( 'acfcs_store_meta', $value, $post_id );
    330                 }
     327               
     328                if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) ) {
     329                    do_action( 'acfcs_store_meta', $value, $post_id );
     330                }
    331331
    332332                return $value;
  • acf-city-selector/tags/1.14.0/admin/acfcs-search.php

    r2791052 r3133754  
    113113
    114114                                    <div class="acfcs__search-criteria acfcs__search-criteria--search">
    115                                         <label for="acfcs_search" class="screen-reader-text"><?php esc_attr_e( 'Search term', 'acf-city-selector' ); ?></label>
     115                                        <label for="acfcs_search" class="screen-reader-text"><?php esc_attr_e( 'Search term', 'acf-city-selector' ); ?></label>
    116116                                        <input name="acfcs_search" id="acfcs_search" type="text" value="<?php if ( false != $searched_term ) { echo stripslashes( $searched_term ); } ?>" placeholder="<?php esc_html_e( 'City name', 'acf-city-selector' ); ?>">
    117117                                    </div>
     
    120120
    121121                                    <div class="acfcs__search-criteria acfcs__search-criteria--limit">
    122                                         <label for="acfcs_limit" class="screen-reader-text"><?php esc_attr_e( 'Limit', 'acf-city-selector' ); ?></label>
     122                                        <label for="acfcs_limit" class="screen-reader-text"><?php esc_attr_e( 'Limit', 'acf-city-selector' ); ?></label>
    123123                                        <input name="acfcs_limit" id="acfcs_limit" type="number" value="<?php if ( false != $selected_limit ) { echo $selected_limit; } ?>" placeholder="<?php esc_html_e( 'Limit', 'acf-city-selector' ); ?>">
    124124                                    </div>
     
    127127
    128128                                    <div class="acfcs__search-criteria acfcs__search-criteria--orderby">
    129                                         <label for="acfcs_orderby" class="screen-reader-text"><?php esc_attr_e( 'Order by', 'acf-city-selector' ); ?></label>
     129                                        <label for="acfcs_orderby" class="screen-reader-text"><?php esc_attr_e( 'Order by', 'acf-city-selector' ); ?></label>
    130130                                        <select name="acfcs_orderby" id="acfcs_orderby">
    131131                                            <option value="">
  • acf-city-selector/tags/1.14.0/admin/acfcs-settings.php

    r2685642 r3133754  
    6161
    6262                        <form method="post" action="">
    63                             <input name="acfcs_delete_transients" value="<?php echo wp_create_nonce( 'acfcs-delete-transients-nonce' ); ?>" type="hidden" />
    64                             <?php echo sprintf( '<h2>%s</h2>', esc_html__( 'Delete transients', 'acf-city-selector' ) ); ?>
    65                             <?php echo sprintf( '<p>%s</p>', esc_html__( "If you're seeing unexpected results in your dropdowns, try clearing all transients with this option.", 'acf-city-selector' ) ); ?>
    66                             <input type="submit" class="button button-primary" value="<?php esc_html_e( "Delete transients", 'acf-city-selector' ); ?>" />
    67                         </form>
    68 
    69                         <br /><hr />
    70 
    71                         <form method="post" action="">
    7263                            <input name="acfcs_truncate_table_nonce" value="<?php echo wp_create_nonce( 'acfcs-truncate-table-nonce' ); ?>" type="hidden" />
    7364                            <?php echo sprintf( '<h2>%s</h2>', esc_html__( 'Clear the database', 'acf-city-selector' ) ); ?>
  • acf-city-selector/tags/1.14.0/admin/admin-right.php

    r2791052 r3133754  
    2525            echo sprintf( '<p>%s</p>', esc_html__( 'If you have some good suggestions for improvements and/or new features, please share them with us, maybe we can incorporate it.', 'acf-city-selector' ) );
    2626        ?>
    27 
    2827    </div>
    2928</div>
  • acf-city-selector/tags/1.14.0/inc/acfcs-actions.php

    r3074624 r3133754  
    11<?php
    22    /**
    3      * Function to delete transients
     3     * Do stuff after certain imports
    44     *
    5      * @param false $country_code
     5     * @param $country_code
     6     *
     7     * @return void
    68     */
    7     function acfcs_delete_transients( $country_code = false ) {
    8         if ( false != $country_code ) {
    9             delete_transient( 'acfcs_states_' . strtolower( $country_code ) );
    10 
    11             // get states for country code
    12             $states = acfcs_get_states( $country_code );
    13             foreach( $states as $key => $state ) {
    14                 $country_code_with_state = strtolower( $key );
    15                 delete_transient( 'acfcs_cities_' . $country_code_with_state );
    16             }
     9    function acfcs_reimport_cities( $country_code = false ) {
     10        if ( $country_code && in_array( $country_code, [ 'nl', 'be' ] ) ) {
     11            update_option( 'acfcs_city_update_1_8_0_' . $country_code, 'done' );
    1712           
    18         } else {
    19             delete_transient( 'acfcs_countries' );
    20             $countries = acfcs_get_countries( false, false, true );
    21 
    22             if ( ! empty( $countries ) ) {
    23                 foreach( $countries as $country_code => $label ) {
    24                     do_action( 'acfcs_delete_transients', $country_code );
    25                     delete_transient( sprintf( 'acfcs_states_%s', $country_code ) );
    26                 }
     13            $belgium_done     = get_option( 'acfcs_city_update_1_8_0_be' );
     14            $netherlands_done = get_option( 'acfcs_city_update_1_8_0_nl' );
     15           
     16            if ( $belgium_done && $netherlands_done ) {
     17                delete_option( 'acfcs_city_update_1_8_0_be' );
     18                delete_option( 'acfcs_city_update_1_8_0_nl' );
     19                update_option( 'acfcs_city_update_1_8_0', 'done' );
    2720            }
    2821        }
    2922    }
    30     add_action( 'acfcs_delete_transients', 'acfcs_delete_transients' );
    31     add_action( 'acfcs_after_success_import', 'acfcs_delete_transients' );
    32     add_action( 'acfcs_after_success_import_raw', 'acfcs_delete_transients' );
    33     add_action( 'acfcs_after_success_nuke', 'acfcs_delete_transients' );
    34 
    35 
    36     /**
    37      * Do stuff after certain imports
    38      *
    39      * @param $country_code
    40      *
    41      * @return void
    42      */
    43     function acfcs_reimport_cities( $country_code = false ) {
    44         if ( $country_code && in_array( $country_code, [ 'nl', 'be' ] ) ) {
    45             update_option( 'acfcs_city_update_1_8_0_' . $country_code, 'done' );
    46 
    47             $belgium_done     = get_option( 'acfcs_city_update_1_8_0_be' );
    48             $netherlands_done = get_option( 'acfcs_city_update_1_8_0_nl' );
    49 
    50             if ( $belgium_done && $netherlands_done ) {
    51                 delete_option( 'acfcs_city_update_1_8_0_be' );
    52                 delete_option( 'acfcs_city_update_1_8_0_nl' );
    53                 update_option( 'acfcs_city_update_1_8_0', 'done' );
    54             }
    55         }
    56     }
    57     add_action( 'acfcs_after_success_import', 'acfcs_reimport_cities' );
    58 
    59 
    60     /**
    61      * Save location as single meta values
    62      *
    63      * @param $value
    64      * @param $post_id
    65      *
    66      * @return void
    67      */
    68     function acfcs_save_single_meta( $value, $post_id ) {
    69         if ( isset( $_POST[ 'store_meta' ] ) && 1 == $_POST[ 'store_meta' ] ) {
    70             if ( ! empty( $value[ 'countryCode' ] ) ) {
    71                 update_post_meta( $post_id, 'acfcs_search_country', $value[ 'countryCode' ] );
    72             }
    73             if ( ! empty( $value[ 'stateCode' ] ) ) {
    74                 update_post_meta( $post_id, 'acfcs_search_state', $value[ 'stateCode' ] );
    75             }
    76             if ( ! empty( $value[ 'cityName' ] ) ) {
    77                 update_post_meta( $post_id, 'acfcs_search_city', $value[ 'cityName' ] );
    78             }
    79         } elseif ( $post_id ) {
    80             // remove meta
    81             delete_post_meta( $post_id, 'acfcs_search_country' );
    82             delete_post_meta( $post_id, 'acfcs_search_state' );
    83             delete_post_meta( $post_id, 'acfcs_search_city' );
    84         }
    85     }
    86     add_action( 'acfcs_store_meta', 'acfcs_save_single_meta', 10, 2 );
     23    add_action( 'acfcs_after_success_import', 'acfcs_reimport_cities' );
     24   
     25   
     26    /**
     27     * Save location as single meta values
     28     *
     29     * @param $value
     30     * @param $post_id
     31     *
     32     * @return void
     33     */
     34    function acfcs_save_single_meta( $value, $post_id ) {
     35        if ( isset( $_POST[ 'store_meta' ] ) && 1 == $_POST[ 'store_meta' ] ) {
     36            if ( ! empty( $value[ 'countryCode' ] ) ) {
     37                update_post_meta( $post_id, 'acfcs_search_country', $value[ 'countryCode' ] );
     38            }
     39            if ( ! empty( $value[ 'stateCode' ] ) ) {
     40                update_post_meta( $post_id, 'acfcs_search_state', $value[ 'stateCode' ] );
     41            }
     42            if ( ! empty( $value[ 'cityName' ] ) ) {
     43                update_post_meta( $post_id, 'acfcs_search_city', $value[ 'cityName' ] );
     44            }
     45        } elseif ( $post_id ) {
     46            // remove meta
     47            delete_post_meta( $post_id, 'acfcs_search_country' );
     48            delete_post_meta( $post_id, 'acfcs_search_state' );
     49            delete_post_meta( $post_id, 'acfcs_search_city' );
     50        }
     51    }
     52    add_action( 'acfcs_store_meta', 'acfcs_save_single_meta', 10, 2 );
  • acf-city-selector/tags/1.14.0/inc/acfcs-ajax.php

    r2841215 r3133754  
    2727                }
    2828            }
    29 
     29           
    3030            if ( ! isset( $field[ 'show_labels' ] ) && isset( $_POST[ 'show_labels' ] ) ) {
    31                 $field[ 'show_labels' ] = ( '1' == sanitize_text_field( $_POST[ 'show_labels' ] ) ) ? true : false;
    32             }
     31                $field[ 'show_labels' ] = ( '1' == sanitize_text_field( $_POST[ 'show_labels' ] ) ) ? true : false;
     32            }
    3333
    3434            if ( isset( $country_code ) ) {
     
    8080                }
    8181            }
    82 
     82           
    8383            if ( ! isset( $field[ 'show_labels' ] ) && isset( $_POST[ 'show_labels' ] ) ) {
    84                 $show_labels = sanitize_text_field( $_POST[ 'show_labels' ] );
    85                 if ( '1' == $show_labels ) {
    86                     $field[ 'show_labels' ] = true;
    87                 } elseif ( '0' == $show_labels ) {
    88                     $field[ 'show_labels' ] = false;
    89                 }
     84                $show_labels = sanitize_text_field( $_POST[ 'show_labels' ] );
     85                if ( '1' == $show_labels ) {
     86                    $field[ 'show_labels' ] = true;
     87                } elseif ( '0' == $show_labels ) {
     88                    $field[ 'show_labels' ] = false;
     89                }
    9090            }
    9191
  • acf-city-selector/tags/1.14.0/inc/acfcs-functions.php

    r2841215 r3133754  
    1818     */
    1919    function acfcs_get_countries( $show_first = true, $field = false, $force = false ) {
    20         $countries            = array();
     20        $countries            = [];
    2121        $select_country_label = apply_filters( 'acfcs_select_country_label', esc_html__( 'Select a country', 'acf-city-selector' ) );
    2222        $show_labels          = ( isset( $field[ 'show_labels' ] ) ) ? $field[ 'show_labels' ] : true;
    23 
     23       
    2424        if ( $show_first ) {
    2525            $countries[ '' ] = '-';
     
    2828            }
    2929        }
    30 
    31         global $wpdb;
    32         $table   = $wpdb->prefix . 'cities';
    33         $results = $wpdb->get_results( "SELECT * FROM $table GROUP BY country ORDER BY country ASC" );
     30       
     31        global $wpdb;
     32        $table   = $wpdb->prefix . 'cities';
     33        $results = $wpdb->get_results( "SELECT * FROM $table GROUP BY country ORDER BY country ASC" );
    3434
    3535        if ( ! empty( $results ) ) {
    36             $country_results = array();
     36            $country_results = [];
    3737            foreach ( $results as $data ) {
    3838                if ( isset( $data->country_code ) && isset( $data->country ) ) {
     
    5959        $select_province_state_label = apply_filters( 'acfcs_select_province_state_label', esc_attr__( 'Select a province/state', 'acf-city-selector' ) );
    6060        $show_labels                 = ( isset( $field[ 'show_labels' ] ) ) ? $field[ 'show_labels' ] : true;
    61         $states                      = array();
    62 
     61        $states                      = [];
     62       
    6363        if ( $show_first ) {
    6464            if ( $show_labels ) {
     
    7070
    7171        if ( false != $country_code ) {
    72             $transient = get_transient( 'acfcs_states_' . strtolower( $country_code ) );
    73             if ( false == $transient || is_array( $transient ) && empty( $transient ) ) {
    74                 $order = ' ORDER BY state_name ASC';
    75                 if ( 'FR' == $country_code ) {
    76                     $order = " ORDER BY LENGTH(state_name), state_name";
    77                 }
    78 
    79                 global $wpdb;
    80                 $table   = $wpdb->prefix . 'cities';
    81                 $sql     = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s GROUP BY state_code" . $order, strtoupper( $country_code ) );
    82                 $results = $wpdb->get_results( $sql );
    83 
    84                 $state_results = array();
    85                 foreach ( $results as $data ) {
    86                     $state_results[ strtoupper( $country_code ) . '-' . $data->state_code ] = esc_attr__( $data->state_name, 'acf-city-selector' );
    87                 }
    88 
    89                 set_transient( 'acfcs_states_' . strtolower( $country_code ), $state_results, DAY_IN_SECONDS );
    90 
    91                 $states = array_merge( $states, $state_results );
    92 
    93             } else {
    94                 $states = array_merge( $states, $transient );
    95             }
     72            $order = ' ORDER BY state_name ASC';
     73            if ( 'FR' == $country_code ) {
     74                $order = " ORDER BY LENGTH(state_name), state_name";
     75            }
     76           
     77            global $wpdb;
     78            $table         = $wpdb->prefix . 'cities';
     79            $sql           = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s GROUP BY state_code" . $order, strtoupper( $country_code ) );
     80            $state_results = [];
     81            $results       = $wpdb->get_results( $sql );
     82           
     83            foreach ( $results as $data ) {
     84                $state_results[ strtoupper( $country_code ) . '-' . $data->state_code ] = esc_attr__( $data->state_name, 'acf-city-selector' );
     85            }
     86           
     87            $states = array_merge( $states, $state_results );
    9688        }
    9789
     
    110102     */
    111103    function acfcs_get_cities( $country_code = false, $state_code = false, $field = false ) {
    112         $cities            = array();
    113         $cities_transient  = false;
     104        $cities            = [];
    114105        $select_city_label = apply_filters( 'acfcs_select_city_label', esc_attr__( 'Select a city', 'acf-city-selector' ) );
    115         $set_transient     = false;
    116106        $show_labels       = ( isset( $field[ 'show_labels' ] ) ) ? $field[ 'show_labels' ] : true;
    117107
     
    122112        }
    123113
    124         if ( $country_code && ! $state_code ) {
    125             $cities_transient = get_transient( 'acfcs_cities_' . strtolower( $country_code ) );
    126         } elseif ( $country_code && $state_code ) {
    127             $cities_transient = get_transient( 'acfcs_cities_' . strtolower( $country_code ) . '-' . strtolower( $state_code ) );
    128         }
    129 
    130         if ( false == $cities_transient || empty( $cities_transient ) ) {
    131             $set_transient = true;
    132         } else {
    133             foreach ( $cities_transient as $data ) {
    134                 $city_array[ esc_attr__( $data, 'acf-city-selector' ) ] = esc_attr__( $data, 'acf-city-selector' );
     114        if ( $country_code ) {
     115            global $wpdb;
     116            $table = $wpdb->prefix . 'cities';
     117            $query = "SELECT * FROM $table";
     118           
     119            if ( $state_code ) {
     120                if ( 3 < strlen( $state_code ) ) {
     121                    $state_code = substr( $state_code, 3 );
     122                }
     123                $query = $wpdb->prepare( $query . " WHERE country_code = %s AND state_code = %s ORDER BY state_name, city_name ASC", $country_code, $state_code );
     124            } elseif ( $country_code ) {
     125                $query = $wpdb->prepare( $query . " WHERE country_code = %s", $country_code );
     126            }
     127           
     128            $city_results = [];
     129            $results      = $wpdb->get_results( $query );
     130           
     131            foreach ( $results as $data ) {
     132                $city_results[] = [
     133                    'city_name' => $data->city_name,
     134                ];
     135            }
     136
     137            if ( ! empty( $city_results ) ) {
     138                uasort( $city_results, 'acfcs_sort_array_with_quotes' );
     139            }
     140            foreach ( $city_results as $data ) {
     141                $city_array[ esc_attr__( $data[ 'city_name' ], 'acf-city-selector' ) ] = esc_attr__( $data[ 'city_name' ], 'acf-city-selector' );
    135142            }
    136143            if ( isset( $city_array ) ) {
     
    139146        }
    140147
    141         if ( $set_transient ) {
    142             if ( false !== $country_code ) {
    143                 global $wpdb;
    144                 $table = $wpdb->prefix . 'cities';
    145                 $query = "SELECT * FROM $table";
    146                 if ( $country_code && $state_code ) {
    147                     if ( 3 < strlen( $state_code ) ) {
    148                         $state_code = substr( $state_code, 3 );
    149                     }
    150                     $query = $wpdb->prepare( $query . " WHERE country_code = %s AND state_code = %s ORDER BY state_name, city_name ASC", $country_code, $state_code );
    151                 } elseif ( $country_code ) {
    152                     $query = $wpdb->prepare( $query . " WHERE country_code = %s", $country_code );
    153                 }
    154                 $city_results = array();
    155                 $results      = $wpdb->get_results( $query );
    156                 foreach ( $results as $data ) {
    157                     $city_results[] = [
    158                         'city_name' => $data->city_name,
    159                     ];
    160                 }
    161 
    162                 if ( ! empty( $city_results ) ) {
    163                     uasort( $city_results, 'acfcs_sort_array_with_quotes' );
    164                 }
    165                 foreach ( $city_results as $data ) {
    166                     $city_array[ esc_attr__( $data[ 'city_name' ], 'acf-city-selector' ) ] = esc_attr__( $data[ 'city_name' ], 'acf-city-selector' );
    167                 }
    168                 if ( isset( $city_array ) ) {
    169                     $cities = array_merge( $cities, $city_array );
    170                 }
    171                 if ( ! $state_code ) {
    172                     set_transient( 'acfcs_cities_' . strtolower( $country_code ), $city_array, DAY_IN_SECONDS );
    173                 } elseif ( $state_code ) {
    174                     set_transient( 'acfcs_cities_' . strtolower( $country_code ) . '-' . strtolower( $state_code ), $city_array, DAY_IN_SECONDS );
    175                 }
    176             }
    177         }
    178 
    179148        return $cities;
    180149    }
     
    190159    function acfcs_get_country_name( $country_code = false ) {
    191160        if ( false != $country_code ) {
    192             global $wpdb;
    193             $table   = $wpdb->prefix . 'cities';
    194             $query   = $wpdb->prepare( "SELECT country FROM $table WHERE country_code = %s", $country_code );
    195             $country = $wpdb->get_row( $query );
     161            global $wpdb;
     162            $table   = $wpdb->prefix . 'cities';
     163            $query   = $wpdb->prepare( "SELECT country FROM $table WHERE country_code = %s", $country_code );
     164            $country = $wpdb->get_row( $query );
    196165
    197166            if ( isset( $country->country ) ) {
     
    207176        return $country_code;
    208177    }
    209 
    210 
    211     /**
     178   
     179   
     180    /**
    212181     * Checks if there are any cities in the database (for page availability)
    213     *
    214     * @param $country_code
    215     *
    216     * @return bool
    217     */
     182    *
     183    * @param $country_code
     184    *
     185    * @return bool
     186    */
    218187    function acfcs_has_cities( $country_code = false ) {
    219188        global $wpdb;
    220         $table = $wpdb->prefix . 'cities';
    221         $query = "SELECT * FROM $table LIMIT 1";
    222         if ( $country_code ) {
    223             $query = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s LIMIT 1", $country_code );
    224         }
     189        $table = $wpdb->prefix . 'cities';
     190        $query = "SELECT * FROM $table LIMIT 1";
     191
     192        if ( $country_code ) {
     193            $query = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s LIMIT 1", $country_code );
     194        }
    225195
    226196        $results = $wpdb->get_results( $query );
     
    240210     */
    241211    function acfcs_check_if_files() {
    242         $actual_files = [];
    243         $target_dir   = acfcs_upload_folder();
    244 
    245         if ( is_dir( $target_dir ) ) {
     212        $actual_files = [];
     213        $target_dir   = acfcs_upload_folder();
     214       
     215        if ( is_dir( $target_dir ) ) {
    246216            $file_index = scandir( $target_dir );
    247             $excluded_files = [
     217            $default_excluded_files = [
    248218                '.',
    249219                '..',
     
    251221                'debug.json',
    252222            ];
    253 
     223            $excluded_files = apply_filters( 'acfcs_exclude_files', $default_excluded_files );
     224           
    254225            if ( is_array( $file_index ) ) {
    255226                foreach ( $file_index as $file ) {
     
    281252    function acfcs_csv_to_array( $file_name, $upload_folder = '', $delimiter = ';', $verify = false, $max_lines = false ) {
    282253        $upload_folder = ( ! empty( $upload_folder ) ) ? $upload_folder : acfcs_upload_folder( '/' );
    283         $csv_array     = array();
     254        $csv_array     = [];
    284255        $empty_array   = false;
    285256        $errors        = ACF_City_Selector::acfcs_errors();
    286         $new_array     = array();
    287 
     257        $new_array     = [];
     258       
    288259        if ( ( file_exists( $upload_folder . $file_name ) && $handle = fopen( $upload_folder . $file_name, "r" ) ) !== false ) {
    289260            $column_benchmark = 5;
     
    313284                if ( $errors->has_errors() ) {
    314285                    $empty_array = true;
    315                     $new_array   = array();
     286                    $new_array   = [];
    316287                } else {
    317288                    // create a new array for each row
    318                     $new_line = array();
     289                    $new_line = [];
    319290                    foreach ( $csv_line as $item ) {
    320291                        $new_line[] = $item;
     
    418389        $url     = ACFCS_WEBSITE_URL . '/wp-json/countries/v1/' . $endpoint;
    419390        $request = new WP_Http;
    420         $result  = $request->request( $url, array( 'method' => 'GET' ) );
     391        $result  = $request->request( $url, [ 'method' => 'GET' ] );
    421392        if ( 200 == $result[ 'response' ][ 'code' ] ) {
    422393            $response = json_decode( $result[ 'body' ] );
     
    425396        }
    426397
    427         return array();
     398        return [];
    428399    }
    429400
     
    436407    function acfcs_get_countries_info() {
    437408        global $wpdb;
    438         $table   = $wpdb->prefix . 'cities';
    439         $results = $wpdb->get_results( "SELECT country_code FROM $table GROUP BY country_code ORDER BY country_code ASC" );
    440 
    441         $acfcs_info = array();
     409        $acfcs_info = [];
     410        $table      = $wpdb->prefix . 'cities';
     411        $results    = $wpdb->get_results( "SELECT country_code FROM $table GROUP BY country_code ORDER BY country_code ASC" );
     412       
    442413        foreach ( $results as $data ) {
    443             $country_code = $data->country_code;
    444             $query        = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s ORDER BY country_code ASC", $country_code );
    445             $results      = $wpdb->get_results( $query );
     414            $country_code = $data->country_code;
     415            $query        = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s ORDER BY country_code ASC", $country_code );
     416            $results      = $wpdb->get_results( $query );
    446417
    447418            $acfcs_info[ $country_code ] = [
     
    478449    function acfcs_custom_sort_with_quotes( $city ) {
    479450        // strip quote marks
    480         if ( strpos( $city, "'s" ) !== false ) {
    481             $city = trim( $city, '\'s ' );
    482             $city = preg_replace( '/^\s*\'s \s+/i', '', $city );
    483         } elseif ( strpos( $city, "'t" ) !== false ) {
    484             $city = trim( $city, '\'t ' );
    485             $city = preg_replace( '/^\s*\'t \s+/i', '', $city );
    486         }
     451        if ( strpos( $city, "'s" ) !== false ) {
     452            $city = trim( $city, '\'s ' );
     453            $city = preg_replace( '/^\s*\'s \s+/i', '', $city );
     454        } elseif ( strpos( $city, "'t" ) !== false ) {
     455            $city = trim( $city, '\'t ' );
     456            $city = preg_replace( '/^\s*\'t \s+/i', '', $city );
     457        }
    487458
    488459        return $city;
     
    578549        return $dropdown;
    579550    }
    580 
    581 
    582     function acfcs_render_hidden_field( $name, $value ) {
    583         if ( $name && $value ) {
    584             return sprintf( '<input type="hidden" name="%s" value="%s" />', $name, $value );
    585         }
    586 
    587         return false;
     551   
     552   
     553    function acfcs_render_hidden_field( $name, $value ) {
     554        if ( $name && $value ) {
     555            return sprintf( '<input type="hidden" name="%s" value="%s" />', $name, $value );
     556        }
     557       
     558        return false;
    588559    }
    589560
     
    626597                            foreach ( $csv_array[ 'data' ] as $line ) {
    627598                                $line_number++;
    628 
    629                                 $city_row = array(
     599                               
     600                                $city_row = [
    630601                                    'city_name'    => $line[ 0 ],
    631602                                    'state_code'   => $line[ 1 ],
     
    633604                                    'country_code' => $line[ 3 ],
    634605                                    'country'      => $line[ 4 ],
    635                                 );
    636 
     606                                ];
     607                               
    637608                                global $wpdb;
    638609                                $wpdb->insert( $wpdb->prefix . 'cities', $city_row );
     
    661632                foreach ( $verified_data as $line ) {
    662633                    $line_number++;
    663 
    664                     $city_row = array(
     634                   
     635                    $city_row = [
    665636                        'city_name'    => $line[ 0 ],
    666637                        'state_code'   => $line[ 1 ],
     
    668639                        'country_code' => $line[ 3 ],
    669640                        'country'      => $line[ 4 ],
    670                     );
    671 
     641                    ];
     642                   
    672643                    $wpdb->insert( $wpdb->prefix . 'cities', $city_row );
    673644                }
     
    709680    function acfcs_delete_country( $countries ) {
    710681        $country_names_and       = false;
    711         $sanitized_country_codes = array();
     682        $sanitized_country_codes = [];
     683       
    712684        foreach( $countries as $country_code ) {
    713             $sanitized_country_code    = sanitize_text_field( $country_code );
     685            $sanitized_country_code    = sanitize_text_field( strtoupper( $country_code ) );
    714686            $sanitized_country_codes[] = $sanitized_country_code;
    715687            $country_names[]           = acfcs_get_country_name( $sanitized_country_code );
    716688        }
     689       
    717690        if ( ! empty( $country_names ) ) {
    718691            $country_names_quotes = "'" . implode( "', '", $country_names ) . "'";
     
    725698
    726699        if ( ! empty( $sanitized_country_codes ) ) {
     700            if ( 1 === count( $sanitized_country_codes ) ) {
     701                $country_string = strtoupper( $sanitized_country_codes[ 0 ] );
     702            } else {
     703                $country_string = strtoupper( "'" . implode( "', '", $sanitized_country_codes ) . "'" );
     704            }
     705           
    727706            global $wpdb;
    728             $table          = $wpdb->prefix . 'cities';
    729             $country_string = strtoupper( "'" . implode( "', '", $sanitized_country_codes ) . "'" );
    730             $query          = $wpdb->prepare( "DELETE FROM $table WHERE `country_code` IN (%s)", $country_string );
    731             $result         = $wpdb->query( $query );
     707            $table = $wpdb->prefix . 'cities';
     708            $query  = $wpdb->prepare( "DELETE FROM $table WHERE country_code IN (%s)", $country_string );
     709            $result = $wpdb->query( $query );
    732710
    733711            if ( $result > 0 ) {
    734                 ACF_City_Selector::acfcs_errors()->add( 'success_country_remove', sprintf( esc_html__( 'You have successfully removed all entries for %s.', 'acf-city-selector' ), $country_names_and ) );
    735                 foreach( $countries as $country_code ) {
    736                     do_action( 'acfcs_delete_transients', $country_code );
    737                 }
     712                ACF_City_Selector::acfcs_errors()->add( 'success_country_remove', sprintf( esc_html__( 'You have successfully removed all entries for %s.', 'acf-city-selector' ), $country_names_and ) );
    738713            }
    739714        }
     
    766741    function acfcs_render_preview_results( $csv_data = [] ) {
    767742        $table = '';
    768         if ( ! empty( $csv_data ) ) {
     743        if ( ! empty( $csv_data ) ) {
    769744            $table_columns = [
    770745                esc_html__( 'City', 'acf-city-selector' ),
     
    793768            $table      = sprintf( '<table class="acfcs__table acfcs__table--preview-result scrollable">%s%s</table>', $table_headers, $table_body );
    794769        }
    795 
    796         return $table;
     770       
     771        return $table;
    797772    }
    798773
     
    807782    function acfcs_get_states_optgroup() {
    808783        $results = acfcs_get_countries( false );
    809         $states  = [];
     784        $states  = [];
    810785
    811786        // if there is at least 1 country
     
    820795            // get states for these countries
    821796            if ( ! empty( $countries ) ) {
    822                 global $wpdb;
    823                 $table = $wpdb->prefix . 'cities';
    824 
    825                 foreach ( $countries as $country ) {
    826                     $states[] = array(
     797                global $wpdb;
     798                $table = $wpdb->prefix . 'cities';
     799               
     800                foreach( $countries as $country ) {
     801                    $states[] = [
    827802                        'state' => 'open_optgroup',
    828803                        'name'  => esc_attr__( acfcs_get_country_name( $country[ 'code' ] ), 'acf-city-selector' ),
    829                     );
    830 
     804                    ];
     805                   
    831806                    $order = 'ORDER BY state_name ASC';
    832807                    if ( 'FR' == $country[ 'code' ] ) {
     
    840815                    if ( count( $results ) > 0 ) {
    841816                        foreach ( $results as $data ) {
    842                             $states[] = array(
     817                            $states[] = [
    843818                                'state' => strtolower( $data->country_code ) . '-' . strtolower( $data->state_code ),
    844819                                'name'  => esc_attr__( $data->state_name, 'acf-city-selector' ),
    845                             );
     820                            ];
    846821                        }
    847822                    }
    848 
    849                     $states[] = array(
     823                   
     824                    $states[] = [
    850825                        'state' => 'close_optgroup',
    851826                        'name'  => '',
    852                     );
    853                 }
    854             }
    855         }
    856 
    857         return $states;
     827                    ];
     828                }
     829            }
     830        }
     831       
     832        return $states;
    858833    }
    859834
     
    868843    function acfcs_get_searched_cities() {
    869844        global $wpdb;
     845        $orderby                 = false;
     846        $table                   = $wpdb->prefix . 'cities';
    870847        $search_criteria_state   = ( isset( $_POST[ 'acfcs_state' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_state' ] ) : false;
    871848        $search_criteria_country = ( isset( $_POST[ 'acfcs_country' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_country' ] ) : false;
    872         $search_limit            = false;
    873849        $searched_orderby        = ( ! empty( $_POST[ 'acfcs_orderby' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_orderby' ] ) : false;
    874850        $searched_term           = ( ! empty( $_POST[ 'acfcs_search' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_search' ] ) : false;
    875851        $selected_limit          = ( ! empty( $_POST[ 'acfcs_limit' ] ) ) ? (int) $_POST[ 'acfcs_limit' ] : 100;
    876         $where                   = array();
    877 
     852        $select                  = "SELECT * FROM $table WHERE";
     853       
    878854        if ( false != $search_criteria_state ) {
    879             $where[] = "state_code = '" . substr( $search_criteria_state, 3, 3) . "' AND country_code = '" . substr( $search_criteria_state, 0, 2) . "'";
     855            $select .= " state_code = '" . strtoupper( substr( $search_criteria_state, 3, 3 ) ) . "' AND country_code = '" . strtoupper( substr( $search_criteria_state, 0, 2 ) ) . "'";
    880856        } elseif ( false != $search_criteria_country ) {
    881             $where[] = "country_code = '" . $search_criteria_country . "'";
    882         }
     857            $select .= sprintf( " country_code = '%s'", $search_criteria_country );
     858        }
     859       
    883860        if ( false != $searched_term ) {
    884             $search[] = 'city_name LIKE "%' . $searched_term . '%"';
     861            $search = ' AND city_name LIKE "%' . $searched_term . '%"';
    885862
    886863            if ( $search_criteria_country || $search_criteria_state ) {
    887                 $where[] = '(' . implode( ' OR ', $search ) . ')';
    888             } else {
    889                 $where[] = implode( ' OR ', $search );
    890             }
    891 
    892         }
     864                $select .= $search;
     865            }
     866        }
     867
     868        if ( 'state' == $searched_orderby ) {
     869            $select .= ' ORDER BY state_name ASC, city_name ASC';
     870        } else {
     871            $select .= ' ORDER BY city_name ASC, state_name ASC';
     872        }
     873
    893874        if ( 0 != $selected_limit ) {
    894             $search_limit = "LIMIT " . $selected_limit;
    895         }
    896 
    897         if ( ! empty( $where ) ) {
    898             $where   = "WHERE " . implode( ' AND ', $where );
    899         } else {
    900             $where = false;
    901         }
    902 
    903         if ( 'state' == $searched_orderby ) {
    904             $orderby = 'ORDER BY state_name ASC, city_name ASC';
    905         } else {
    906             $orderby = 'ORDER BY city_name ASC, state_name ASC';
    907         }
    908 
    909         $table  = $wpdb->prefix . 'cities';
    910         $query  = $wpdb->prepare( "SELECT * FROM $table %s %s %s", $where, $orderby, $search_limit );
    911         $cities = $wpdb->get_results( $query );
     875            $select .= " LIMIT " . $selected_limit;
     876        }
     877       
     878        $cities = $wpdb->get_results( $select );
    912879
    913880        return $cities;
     
    923890     */
    924891    function acfcs_get_js_translations() {
    925         $translations = array(
     892        $translations = [
    926893            'no_countries'         => esc_attr__( 'No countries', 'acf-city-selector' ),
    927894            'select_city'          => esc_attr( apply_filters( 'acfcs_select_city_label', __( 'Select a city', 'acf-city-selector' ) ) ),
     
    930897            'select_state'         => esc_attr( apply_filters( 'acfcs_select_province_state_label', __( 'Select a province/state', 'acf-city-selector' ) ) ),
    931898            'select_state_first'   => esc_attr( apply_filters( 'acfcs_select_state_first', __( 'No results (yet), first select a state', 'acf-city-selector' ) ) ),
    932         );
    933 
     899        ];
     900       
    934901        return $translations;
    935902    }
  • acf-city-selector/tags/1.14.0/inc/form-handling.php

    r2841215 r3133754  
    119119                        }
    120120                    }
    121                     $cities  = implode( ', ', $cities );
    122                     $row_ids = implode( ',', $ids );
    123                     $table   = $wpdb->prefix . 'cities';
    124                     $query   = $wpdb->prepare( "DELETE FROM {$table} WHERE id IN (%s)", $row_ids );
    125                     $amount  = $wpdb->query( $query );
     121                    $cities  = implode( ', ', $cities );
     122                    $row_ids = implode( ',', $ids );
     123                    $table   = $wpdb->prefix . 'cities';
     124                    $query   = $wpdb->prepare( "DELETE FROM {$table} WHERE id IN (%s)", $row_ids );
     125                    $amount  = $wpdb->query( $query );
    126126
    127127                    if ( $amount > 0 ) {
     
    133133    }
    134134    add_action( 'admin_init', 'acfcs_delete_rows' );
    135 
    136 
    137     /**
    138      * Form to handle deleting of all transients
    139      */
    140     function acfcs_delete_all_transients() {
    141         if ( isset( $_POST[ 'acfcs_delete_transients' ] ) ) {
    142             if ( ! wp_verify_nonce( $_POST[ 'acfcs_delete_transients' ], 'acfcs-delete-transients-nonce' ) ) {
    143                 ACF_City_Selector::acfcs_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-city-selector' ) );
    144             } else {
    145                 do_action( 'acfcs_delete_transients' );
    146                 ACF_City_Selector::acfcs_errors()->add( 'success_transients_delete', esc_html__( 'You have successfully deleted all transients.', 'acf-city-selector' ) );
    147             }
    148         }
    149     }
    150     add_action( 'admin_init', 'acfcs_delete_all_transients' );
    151135
    152136
     
    201185                    if ( isset( $_POST[ 'acfcs_import_be' ] ) && 1 == $_POST[ 'acfcs_import_be' ] ) {
    202186                        acfcs_import_data( 'be.csv', ACFCS_PLUGIN_PATH . 'import/' );
    203                         do_action( 'acfcs_delete_transients', 'be' );
    204187                    }
    205188                    if ( isset( $_POST[ 'acfcs_import_nl' ] ) && 1 == $_POST[ 'acfcs_import_nl' ] ) {
    206189                        acfcs_import_data( 'nl.csv', ACFCS_PLUGIN_PATH . 'import/' );
    207                         do_action( 'acfcs_delete_transients', 'nl' );
    208190                    }
    209191                    do_action( 'acfcs_after_success_import' );
  • acf-city-selector/tags/1.14.0/languages/acf-city-selector-de_DE.po

    r2841217 r3133754  
    33"Project-Id-Version: ACF City Selector\n"
    44"POT-Creation-Date: 2022-12-29 19:50+0100\n"
    5 "PO-Revision-Date: 2022-12-29 19:50+0100\n"
     5"PO-Revision-Date: 2024-08-08 23:57+0200\n"
    66"Last-Translator: Beee\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.4.3\n"
     12"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     13"X-Generator: Poedit 3.4.4\n"
    1314"X-Poedit-Basepath: ..\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1515"X-Poedit-KeywordsList: __;_e;_n;_n:1,2;_n_noop;_nx_noop;esc_html__;"
    1616"esc_html_e;esc_attr;esc_attr__;esc_attr_e;esc_html__;esc_html_e\n"
     
    2525"countries to get the correct city names."
    2626msgstr ""
     27"Mehrere %s hatten defekte ASCII-Zeichen. Du musst diese Länder neu "
     28"importieren um die korrekten Städtenamen zu erhalten."
    2729
    2830#: ACF_City_Selector.php:169
    29 #, fuzzy, php-format
    30 #| msgid "# cities"
     31#, php-format
    3132msgid "cities in %s"
    32 msgstr "# Städte"
     33msgstr "Städte in %s"
    3334
    3435#: ACF_City_Selector.php:169
    35 #, fuzzy
    36 #| msgid "Import all cities in Holland/The Netherlands"
    3736msgid "cities in Belgium and Netherlands"
    38 msgstr "Importiere alle Städte in Holland/Niederlande"
     37msgstr "Städte in Holland/Niederlande"
    3938
    4039#: ACF_City_Selector.php:261 ACF_City_Selector.php:278
     
    7574
    7675#: ACF_City_Selector.php:334
    77 #, fuzzy, php-format
    78 #| msgid ""
    79 #| "<b>Warning</b>: The \"%s\" plugin will probably not work properly "
    80 #| "(anymore) with %s v4.x. Please upgrade to PRO."
     76#, php-format
    8177msgid ""
    8278"%s: The \"%s\" plugin will probably not work properly (anymore) with %s v4."
    8379"x. Please upgrade to PRO."
    8480msgstr ""
    85 "<b>Warnung</b>: Das Plugin \"%s\" funktioniert warscheinlich leider nicht "
    86 "(mehr) ordnungsgemäß mit %s v4.x. Bitte aktualisiere auf die PRO Version."
     81"%s: Das Plugin \"%s\" funktioniert wahrscheinlich leider nicht (mehr) "
     82"ordnungsgemäß mit %s v4.x. Bitte aktualisiere auf die PRO Version."
    8783
    8884#: ACF_City_Selector.php:335
     
    174170#: admin/acf-city-selector-v5.php:84
    175171msgid "Store location as single meta values"
    176 msgstr ""
     172msgstr "Standort als einzelnen Meta Wert speichern"
    177173
    178174#: admin/acf-city-selector-v5.php:85
    179175msgid "Store meta"
    180 msgstr ""
     176msgstr "Meta speichern"
    181177
    182178#: admin/acf-city-selector-v5.php:352
     
    292288#: admin/acfcs-countries.php:149
    293289msgid "request"
    294 msgstr ""
     290msgstr "anfragen"
    295291
    296292#: admin/acfcs-countries.php:151
     
    310306"Max lines has no effect when verifying. The entire file will be checked."
    311307msgstr ""
     308"Max lines hat keinen Effekt bei der Verifizierung. Die gesamte Datei wird "
     309"geprüft werden."
    312310
    313311#: admin/acfcs-dashboard.php:43
     
    475473#: admin/acfcs-info.php:238
    476474msgid "left-click to open, right-click to save"
    477 msgstr ""
     475msgstr "Linksklick zum öffnen, Rechtsklick zum speichern"
    478476
    479477#: admin/acfcs-preview-form.php:6
     
    564562msgid "You haven't imported any cities yet. Import any files from your %s."
    565563msgstr ""
     564"Du hast noch keine Städte importiert. Importiere Dateien von deiner %s."
    566565
    567566#: admin/acfcs-search.php:68 admin/acfcs-search.php:71
     
    736735#, php-format
    737736msgid "%s for the plugin's official website."
    738 msgstr ""
     737msgstr "%s für die offizielle Plugin Webseite."
    739738
    740739#: admin/admin-right.php:13
    741740msgid "Click here"
    742 msgstr ""
     741msgstr "Klicke hier"
    743742
    744743#: admin/admin-right.php:17
     
    749748#, php-format
    750749msgid "If you need support for this plugin, please turn to %s."
    751 msgstr ""
     750msgstr "Wende dich an %s wenn du Hilfe für diesem Plugin benötigst."
    752751
    753752#: admin/admin-right.php:23
    754753msgid "Requests"
    755 msgstr ""
     754msgstr "Anfragen"
    756755
    757756#: admin/admin-right.php:25
    758 #, fuzzy
    759 #| msgid ""
    760 #| "If you need support for this plugin or if you have some good suggestions "
    761 #| "for improvements and/or new features, please turn to %s."
    762757msgid ""
    763758"If you have some good suggestions for improvements and/or new features, "
     
    781776#: admin/raw-input-form.php:8
    782777msgid "Raw CSV import"
    783 msgstr ""
     778msgstr "Roher CSV Import"
    784779
    785780#: admin/raw-input-form.php:12
     
    10101005"If you need more countries, you can get them on the official website: %s."
    10111006msgstr ""
     1007"Wenn du weitere Länder benötigst, kannst du diese auf der offiziellen "
     1008"Webseite herunterladen: %s."
    10121009
    10131010#: inc/acfcs-help-tabs.php:101
     
    10171014#: inc/acfcs-i18n.php:16
    10181015msgid "Andorra"
    1019 msgstr ""
     1016msgstr "Andorra"
    10201017
    10211018#: inc/acfcs-i18n.php:17
    10221019msgid "Aruba"
    1023 msgstr ""
     1020msgstr "Aruba"
    10241021
    10251022#: inc/acfcs-i18n.php:18
     
    10411038#: inc/acfcs-i18n.php:22
    10421039msgid "China"
    1043 msgstr ""
     1040msgstr "China"
    10441041
    10451042#: inc/acfcs-i18n.php:23
    10461043msgid "Curaçao"
    1047 msgstr ""
     1044msgstr "Curaçao"
    10481045
    10491046#: inc/acfcs-i18n.php:24
     
    10611058#: inc/acfcs-i18n.php:27
    10621059msgid "Grenada"
    1063 msgstr ""
     1060msgstr "Genada"
    10641061
    10651062#: inc/acfcs-i18n.php:28
     
    10731070#: inc/acfcs-i18n.php:30
    10741071msgid "Mexico"
    1075 msgstr ""
     1072msgstr "Mexiko"
    10761073
    10771074#: inc/acfcs-i18n.php:31
     
    10851082#: inc/acfcs-i18n.php:33
    10861083msgid "Portugal"
    1087 msgstr ""
     1084msgstr "Portugal"
    10881085
    10891086#: inc/acfcs-i18n.php:34
     
    11051102#: inc/acfcs-i18n.php:38
    11061103msgid "Uruguay"
    1107 msgstr ""
     1104msgstr "Uruguay"
    11081105
    11091106#: inc/acfcs-i18n.php:39
     
    12331230#, php-format
    12341231#~ msgid ""
    1235 #~ "<strong>!!!</strong> The default delimiters has been changed from "
    1236 #~ "',' (comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
     1232#~ "<strong>!!!</strong> The default delimiters has been changed from ',' "
     1233#~ "(comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
    12371234#~ msgstr ""
    12381235#~ "<strong>!!!</strong> Die Standardtrennzeichen wurden von ',' (Komma) in "
     
    13351332#~ msgstr ""
    13361333#~ "Vielen Dank für die Installation des 'City Selector' Plugins. Ich hoffe "
    1337 #~ "es gefällt dir. Bitte denke über <a href=\"%s\" rel=\"noopener\" target="
    1338 #~ "\"_blank\">eine Spende nach</a> wenn du das Plugin gefällt, damit ich das "
    1339 #~ "Plugin noch besser machen kann."
     1334#~ "es gefällt dir. Bitte denke über <a href=\"%s\" rel=\"noopener\" "
     1335#~ "target=\"_blank\">eine Spende nach</a> wenn du das Plugin gefällt, damit "
     1336#~ "ich das Plugin noch besser machen kann."
    13401337
    13411338#~ msgid "Admin email"
  • acf-city-selector/tags/1.14.0/languages/acf-city-selector-nl_NL.po

    r2841217 r3133754  
    22msgstr ""
    33"Project-Id-Version: ACF City Selector 1.0\n"
    4 "POT-Creation-Date: 2022-12-29 19:49+0100\n"
    5 "PO-Revision-Date: 2022-12-29 19:50+0100\n"
     4"POT-Creation-Date: 2024-07-29 20:47+0200\n"
     5"PO-Revision-Date: 2024-07-29 20:47+0200\n"
    66"Last-Translator: Beee\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.4.3\n"
     12"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     13"X-Generator: Poedit 3.4.4\n"
    1314"X-Poedit-Basepath: ..\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1515"X-Poedit-KeywordsList: __;_e;_x;_ex;_n;_nx;_n:1,2;_n_noop;_nx_noop;"
    1616"esc_html__;esc_html_e;esc_html_x;esc_attr__;esc_attr_e;esc_attr_x\n"
     
    1818"X-Poedit-SearchPathExcluded-0: languages\n"
    1919
    20 #: ACF_City_Selector.php:169
     20#: ACF_City_Selector.php:167
    2121#, php-format
    2222msgid ""
     
    2727"importeren om de correcte namen te krijgen."
    2828
    29 #: ACF_City_Selector.php:169
     29#: ACF_City_Selector.php:167
    3030#, php-format
    3131msgid "cities in %s"
    3232msgstr "steden in %s"
    3333
    34 #: ACF_City_Selector.php:169
     34#: ACF_City_Selector.php:167
    3535msgid "cities in Belgium and Netherlands"
    3636msgstr "steden in België en Nederland"
    3737
    38 #: ACF_City_Selector.php:261 ACF_City_Selector.php:278
    39 #: ACF_City_Selector.php:386
     38#: ACF_City_Selector.php:259 ACF_City_Selector.php:276
     39#: ACF_City_Selector.php:384
    4040msgid "Settings"
    4141msgstr "Instellingen"
    4242
    43 #: ACF_City_Selector.php:277
     43#: ACF_City_Selector.php:275
    4444msgid "Dashboard"
    4545msgstr "Dashboard"
    4646
    47 #: ACF_City_Selector.php:281 ACF_City_Selector.php:388
     47#: ACF_City_Selector.php:279 ACF_City_Selector.php:386
    4848#: admin/acfcs-search.php:148
    4949msgid "Search"
    5050msgstr "Zoeken"
    5151
    52 #: ACF_City_Selector.php:284
     52#: ACF_City_Selector.php:282
    5353msgid "Preview"
    5454msgstr "Preview"
    5555
    56 #: ACF_City_Selector.php:287 ACF_City_Selector.php:389 admin/acfcs-info.php:26
     56#: ACF_City_Selector.php:285 ACF_City_Selector.php:387 admin/acfcs-info.php:26
    5757msgid "Info"
    5858msgstr "Informatie"
    5959
    60 #: ACF_City_Selector.php:290
     60#: ACF_City_Selector.php:288
    6161msgid "Get more countries"
    6262msgstr "Meer landen"
    6363
    64 #: ACF_City_Selector.php:312
     64#: ACF_City_Selector.php:310
    6565#, php-format
    6666msgid ""
     
    7171"werkt \"%s\" niet. Activeer hem <a href=\"%s\">hier</a>."
    7272
    73 #: ACF_City_Selector.php:334
     73#: ACF_City_Selector.php:332
    7474#, php-format
    7575msgid ""
     
    8080"upgrade naar PRO."
    8181
    82 #: ACF_City_Selector.php:335
     82#: ACF_City_Selector.php:333
    8383msgid "Warning"
    8484msgstr "Waarschuwing"
    8585
    86 #: ACF_City_Selector.php:385 admin/acfcs-preview.php:36
     86#: ACF_City_Selector.php:383 admin/acfcs-preview.php:36
    8787msgid "Preview data"
    8888msgstr "Data bekijken"
    8989
    90 #: ACF_City_Selector.php:387 admin/acfcs-countries.php:50
     90#: ACF_City_Selector.php:385 admin/acfcs-countries.php:50
    9191msgid "Get countries"
    9292msgstr "Meer landen"
    9393
    94 #: admin/acf-city-selector-v4.php:29 admin/acf-city-selector-v5.php:34
     94#: admin/acf-city-selector-v4.php:31 admin/acf-city-selector-v5.php:34
    9595msgid "Choice"
    9696msgstr "Keuze"
    9797
    98 #: admin/acf-city-selector-v4.php:64 admin/acf-city-selector-v5.php:102
     98#: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:102
    9999msgid "All fields [default]"
    100100msgstr "Alle velden [standaard]"
    101101
    102 #: admin/acf-city-selector-v4.php:65 admin/acf-city-selector-v5.php:103
     102#: admin/acf-city-selector-v4.php:69 admin/acf-city-selector-v5.php:103
    103103msgid "Country only"
    104104msgstr "Alleen land"
    105105
    106 #: admin/acf-city-selector-v4.php:66 admin/acf-city-selector-v5.php:104
     106#: admin/acf-city-selector-v4.php:70 admin/acf-city-selector-v5.php:104
    107107msgid "Country + State/province"
    108108msgstr "Land + Staat/Provincies"
    109109
    110 #: admin/acf-city-selector-v4.php:67 admin/acf-city-selector-v5.php:105
     110#: admin/acf-city-selector-v4.php:71 admin/acf-city-selector-v5.php:105
    111111msgid "Country + City"
    112112msgstr "Land + Stad"
    113113
    114 #: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:106
     114#: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:106
    115115msgid "State/province + City"
    116116msgstr "Staat/Provincie + Stad"
    117117
    118 #: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:59
     118#: admin/acf-city-selector-v4.php:76 admin/acf-city-selector-v5.php:59
    119119#: admin/acfcs-info.php:170
    120120msgid "Yes"
    121121msgstr "Ja"
    122122
    123 #: admin/acf-city-selector-v4.php:73 admin/acf-city-selector-v5.php:60
     123#: admin/acf-city-selector-v4.php:77 admin/acf-city-selector-v5.php:60
    124124#: admin/acfcs-info.php:170
    125125msgid "No"
    126126msgstr "Nee"
    127127
    128 #: admin/acf-city-selector-v4.php:80 admin/acf-city-selector-v5.php:65
     128#: admin/acf-city-selector-v4.php:84 admin/acf-city-selector-v5.php:65
    129129msgid "Show labels"
    130130msgstr "Toon labels"
    131131
    132 #: admin/acf-city-selector-v4.php:81 admin/acf-city-selector-v5.php:64
     132#: admin/acf-city-selector-v4.php:85 admin/acf-city-selector-v5.php:64
    133133msgid "Show field labels above the dropdown menus"
    134134msgstr "Labels tonen boven de dropdown menu’s"
    135135
    136 #: admin/acf-city-selector-v4.php:97 admin/acf-city-selector-v5.php:96
     136#: admin/acf-city-selector-v4.php:101 admin/acf-city-selector-v5.php:96
    137137msgid "Default country"
    138138msgstr "Default land"
    139139
    140 #: admin/acf-city-selector-v4.php:98 admin/acf-city-selector-v5.php:95
     140#: admin/acf-city-selector-v4.php:102 admin/acf-city-selector-v5.php:95
    141141msgid "Select a default country for a new field"
    142142msgstr "Selecteer een standaard land voor een nieuw veld"
    143143
    144 #: admin/acf-city-selector-v4.php:114 admin/acf-city-selector-v5.php:111
     144#: admin/acf-city-selector-v4.php:118 admin/acf-city-selector-v5.php:111
    145145msgid "Fields to use"
    146146msgstr "Velden om te gebruiken"
    147147
    148 #: admin/acf-city-selector-v4.php:115 admin/acf-city-selector-v5.php:110
     148#: admin/acf-city-selector-v4.php:119 admin/acf-city-selector-v5.php:110
    149149msgid "Select which fields are used"
    150150msgstr "Kies welke velden gebruikt worden"
    151151
    152 #: admin/acf-city-selector-v4.php:178 admin/acf-city-selector-v5.php:160
     152#: admin/acf-city-selector-v4.php:184 admin/acf-city-selector-v5.php:160
    153153msgid ""
    154154"You haven't set a default country, so NO provinces/states and cities will be "
     
    233233
    234234#: admin/acfcs-countries.php:66 admin/acfcs-search.php:172
    235 #: inc/acfcs-functions.php:774 inc/acfcs-help-tabs.php:46
     235#: inc/acfcs-functions.php:749 inc/acfcs-help-tabs.php:46
    236236msgid "Country"
    237237msgstr "Land"
     
    558558
    559559#: admin/acfcs-search.php:68 admin/acfcs-search.php:71
    560 #: inc/acfcs-functions.php:21 inc/acfcs-functions.php:506
    561 #: inc/acfcs-functions.php:928
     560#: inc/acfcs-functions.php:21 inc/acfcs-functions.php:477
     561#: inc/acfcs-functions.php:895
    562562msgid "Select a country"
    563563msgstr "Selecteer een land"
     
    568568
    569569#: admin/acfcs-search.php:89 admin/acfcs-search.php:93
    570 #: inc/acfcs-functions.php:59 inc/acfcs-functions.php:513
    571 #: inc/acfcs-functions.php:930
     570#: inc/acfcs-functions.php:59 inc/acfcs-functions.php:484
     571#: inc/acfcs-functions.php:897
    572572msgid "Select a province/state"
    573573msgstr "Selecteer een provincie/staat"
     
    590590
    591591#: admin/acfcs-search.php:136 admin/acfcs-search.php:170
    592 #: inc/acfcs-functions.php:770 inc/acfcs-help-tabs.php:26
     592#: inc/acfcs-functions.php:745 inc/acfcs-help-tabs.php:26
    593593msgid "City"
    594594msgstr "Stad"
    595595
    596596#: admin/acfcs-search.php:137 admin/acfcs-search.php:171
    597 #: inc/acfcs-functions.php:772 inc/acfcs-help-tabs.php:36
     597#: inc/acfcs-functions.php:747 inc/acfcs-help-tabs.php:36
    598598msgid "State"
    599599msgstr "Staat/provincie"
     
    658658msgstr "Verwijder geselecteerde landen"
    659659
    660 #: admin/acfcs-settings.php:64 admin/acfcs-settings.php:66
    661 msgid "Delete transients"
    662 msgstr "Verwijder transients"
    663 
    664 #: admin/acfcs-settings.php:65
    665 msgid ""
    666 "If you're seeing unexpected results in your dropdowns, try clearing all "
    667 "transients with this option."
    668 msgstr ""
    669 "Als je onverwachte resultaten zien in je dropdowns, probeer dan de "
    670 "transients te verwijderen met deze optie."
    671 
    672 #: admin/acfcs-settings.php:73
     660#: admin/acfcs-settings.php:64
    673661msgid "Clear the database"
    674662msgstr "Maak de database leeg"
    675663
    676 #: admin/acfcs-settings.php:74
     664#: admin/acfcs-settings.php:65
    677665msgid ""
    678666"By selecting this option, you will remove all cities, which are present in "
     
    684672"wilt."
    685673
    686 #: admin/acfcs-settings.php:75
     674#: admin/acfcs-settings.php:66
    687675msgid "Delete everything"
    688676msgstr "Verwijder alles"
    689677
    690 #: admin/acfcs-settings.php:82
     678#: admin/acfcs-settings.php:73
    691679msgid "Delete data"
    692680msgstr "Verwijder data"
    693681
    694 #: admin/acfcs-settings.php:83
     682#: admin/acfcs-settings.php:74
    695683msgid ""
    696684"When the plugin is deleted, all cities are not automatically deleted. Select "
     
    701689"als de plugin wordt verwijderd."
    702690
    703 #: admin/acfcs-settings.php:88 admin/acfcs-settings.php:89
     691#: admin/acfcs-settings.php:79 admin/acfcs-settings.php:80
    704692msgid "Remove cities table on plugin deletion"
    705693msgstr "Verwijder steden bij verwijderen plugin"
    706694
    707 #: admin/acfcs-settings.php:93
     695#: admin/acfcs-settings.php:84
    708696msgid "Save settings"
    709697msgstr "Instellingen opslaan"
     
    794782msgstr ""
    795783
    796 #: inc/acfcs-functions.php:114 inc/acfcs-functions.php:504
    797 #: inc/acfcs-functions.php:927
     784#: inc/acfcs-functions.php:105 inc/acfcs-functions.php:475
     785#: inc/acfcs-functions.php:894
    798786msgid "Select a city"
    799787msgstr "Selecteer een stad"
    800788
    801 #: inc/acfcs-functions.php:300 inc/acfcs-functions.php:305
     789#: inc/acfcs-functions.php:271 inc/acfcs-functions.php:276
    802790msgid "Since your file is not accurate anymore, the file is deleted."
    803791msgstr "Aangezien je bestand fouten bevat, is deze verwijderd."
    804792
    805 #: inc/acfcs-functions.php:301
     793#: inc/acfcs-functions.php:272
    806794#, php-format
    807795msgid "There are too few columns on line %d. %s"
    808796msgstr "Er zijn te weinig kolommen op regel %d. %s"
    809797
    810 #: inc/acfcs-functions.php:309
     798#: inc/acfcs-functions.php:280
    811799#, php-format
    812800msgid "There are too many columns on line %d. %s"
    813801msgstr "Er zijn te veel kolommen op regel %d. %s"
    814802
    815 #: inc/acfcs-functions.php:380
     803#: inc/acfcs-functions.php:351
    816804#, php-format
    817805msgid "There are too few columns on line %d."
    818806msgstr "Er zijn te weinig kolommen op regel %d."
    819807
    820 #: inc/acfcs-functions.php:385
     808#: inc/acfcs-functions.php:356
    821809#, php-format
    822810msgid "There are too many columns on line %d."
    823811msgstr "Er zijn te veel kolommen op regel %d."
    824812
    825 #: inc/acfcs-functions.php:396
     813#: inc/acfcs-functions.php:367
    826814#, php-format
    827815msgid "The length of the country abbreviation on line %d is incorrect."
    828816msgstr "De lengte van de land afkorting op regel %d is incorrect."
    829817
    830 #: inc/acfcs-functions.php:601
     818#: inc/acfcs-functions.php:572
    831819#, php-format
    832820msgid "Congratulations, there appear to be no errors in CSV file: \"%s\"."
    833821msgstr "Gefeliciteerd, er lijken geen fouten te zitten in CSV bestand: \"%s\"."
    834822
    835 #: inc/acfcs-functions.php:642 inc/acfcs-functions.php:644
     823#: inc/acfcs-functions.php:613 inc/acfcs-functions.php:615
    836824#, php-format
    837825msgid "You have successfully imported %d cities from \"%s\"."
    838826msgstr "Gefeliciteerd, je hebt %d steden geïmporteerd uit \"%s\"."
    839827
    840 #: inc/acfcs-functions.php:674
     828#: inc/acfcs-functions.php:645
    841829#, php-format
    842830msgid "Congratulations, you imported 1 city."
     
    845833msgstr[1] "Gefeliciteerd, je hebt %d steden geïmporteerd."
    846834
    847 #: inc/acfcs-functions.php:680 inc/form-handling.php:33
     835#: inc/acfcs-functions.php:651 inc/form-handling.php:33
    848836msgid "You didn't select a file."
    849837msgstr "Je hebt geen bestand gekozen."
    850838
    851 #: inc/acfcs-functions.php:694
     839#: inc/acfcs-functions.php:665
    852840#, php-format
    853841msgid "File \"%s\" successfully deleted."
    854842msgstr "File “%s” is succesvol verwijderd."
    855843
    856 #: inc/acfcs-functions.php:697
     844#: inc/acfcs-functions.php:668
    857845#, php-format
    858846msgid "File \"%s\" is not deleted. Please try again."
    859847msgstr "Het bestand \"%s\" is niet verwijderd. Probeer het aub opnieuw."
    860848
    861 #: inc/acfcs-functions.php:734
     849#: inc/acfcs-functions.php:712
    862850#, php-format
    863851msgid "You have successfully removed all entries for %s."
    864852msgstr "Je hebt alle steden verwijderd voor %s."
    865853
    866 #: inc/acfcs-functions.php:771 inc/acfcs-help-tabs.php:31
     854#: inc/acfcs-functions.php:746 inc/acfcs-help-tabs.php:31
    867855msgid "State code"
    868856msgstr "Staat/provincie code"
    869857
    870 #: inc/acfcs-functions.php:773 inc/acfcs-help-tabs.php:41
     858#: inc/acfcs-functions.php:748 inc/acfcs-help-tabs.php:41
    871859msgid "Country code"
    872860msgstr "Land code"
    873861
    874 #: inc/acfcs-functions.php:926
     862#: inc/acfcs-functions.php:893
    875863msgid "No countries"
    876864msgstr "Geen landen"
    877865
    878 #: inc/acfcs-functions.php:929
     866#: inc/acfcs-functions.php:896
    879867msgid "No results (yet), first select a country"
    880868msgstr "Nog geen resultaten, kies eerst een land"
    881869
    882 #: inc/acfcs-functions.php:931
     870#: inc/acfcs-functions.php:898
    883871msgid "No results (yet), first select a state"
    884872msgstr "Nog geen resultaten, kies eerst een staat/provincie"
     
    11041092#: inc/form-handling.php:8 inc/form-handling.php:30 inc/form-handling.php:64
    11051093#: inc/form-handling.php:88 inc/form-handling.php:109 inc/form-handling.php:143
    1106 #: inc/form-handling.php:159 inc/form-handling.php:178
    1107 #: inc/form-handling.php:198
     1094#: inc/form-handling.php:162 inc/form-handling.php:182
    11081095msgid "Something went wrong, please try again."
    11091096msgstr "Er ging iets fout, probeer het aub nog een keer."
     
    11371124msgstr[1] "Je hebt de volgende steden verwijderd: %s."
    11381125
    1139 #: inc/form-handling.php:146
    1140 msgid "You have successfully deleted all transients."
    1141 msgstr "Je hebt alle transients succesvol verwijderd."
    1142 
    1143 #: inc/form-handling.php:164
     1126#: inc/form-handling.php:148
    11441127msgid "All cities are deleted."
    11451128msgstr "Alle steden zijn verwijderd."
    11461129
    1147 #: inc/form-handling.php:185
     1130#: inc/form-handling.php:169
    11481131msgid "Settings saved"
    11491132msgstr "Instellingen opgeslagen"
     1133
     1134#~ msgid "Delete transients"
     1135#~ msgstr "Verwijder transients"
     1136
     1137#~ msgid ""
     1138#~ "If you're seeing unexpected results in your dropdowns, try clearing all "
     1139#~ "transients with this option."
     1140#~ msgstr ""
     1141#~ "Als je onverwachte resultaten zien in je dropdowns, probeer dan de "
     1142#~ "transients te verwijderen met deze optie."
     1143
     1144#~ msgid "You have successfully deleted all transients."
     1145#~ msgstr "Je hebt alle transients succesvol verwijderd."
    11501146
    11511147#~ msgid "We might ask for this info if support is helping you fix a problem."
     
    11991195#~ msgstr ""
    12001196#~ "Als je meer landen nodig hebt, kan je deze krijgen op de officiële "
    1201 #~ "website: <a href=\"https://acf-city-selector.com/get-countries/\" target="
    1202 #~ "\"_blank\" rel=\"noopener\">acf-city-selector.com</a>."
     1197#~ "website: <a href=\"https://acf-city-selector.com/get-countries/\" "
     1198#~ "target=\"_blank\" rel=\"noopener\">acf-city-selector.com</a>."
    12031199
    12041200#~ msgid "Save data"
     
    12201216#, php-format
    12211217#~ msgid ""
    1222 #~ "<strong>!!!</strong> The default delimiters has been changed from "
    1223 #~ "',' (comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
     1218#~ "<strong>!!!</strong> The default delimiters has been changed from ',' "
     1219#~ "(comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
    12241220#~ msgstr ""
    12251221#~ "<strong>!!!</strong> De default delimiter is gewijzigd van ',' (komma) "
     
    12331229#~ msgstr ""
    12341230#~ "<strong>!!!</strong> In één van de volgende versies (vermoedelijk "
    1235 #~ "0.30.0), wordt de default delimiter gewijzigd van ',' (komma) naar "
    1236 #~ "';' (punt komma). Lees er <a href=\"%s\">%s</a> meer over."
     1231#~ "0.30.0), wordt de default delimiter gewijzigd van ',' (komma) naar ';' "
     1232#~ "(punt komma). Lees er <a href=\"%s\">%s</a> meer over."
    12371233
    12381234#~ msgid "Antwerp"
  • acf-city-selector/tags/1.14.0/languages/acf-city-selector.pot

    r2841217 r3133754  
    33msgstr ""
    44"Project-Id-Version: ACF City Selector\n"
    5 "POT-Creation-Date: 2022-12-29 19:49+0100\n"
     5"POT-Creation-Date: 2024-07-29 20:44+0200\n"
    66"PO-Revision-Date: 2019-09-14 15:00+0200\n"
    77"Last-Translator: Beee\n"
    88"Language-Team: \n"
     9"Language: en\n"
    910"MIME-Version: 1.0\n"
    1011"Content-Type: text/plain; charset=UTF-8\n"
    1112"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.4.3\n"
     13"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     14"X-Generator: Poedit 3.4.4\n"
    1315"X-Poedit-Basepath: ..\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    15 "Language: en\n"
    1616"X-Poedit-KeywordsList: __;_e;_n;_n:1,2;_n_noop;_nx_noop;esc_html__;esc_html_e;esc_attr;esc_attr__;esc_attr_e;esc_html__;esc_html_e\n"
    1717"X-Poedit-SearchPath-0: .\n"
     
    1919"X-Poedit-SearchPathExcluded-1: assets/js/init.js\n"
    2020
    21 #: ACF_City_Selector.php:169
     21#: ACF_City_Selector.php:167
    2222#, php-format
    2323msgid "Several %s had broken ascii characters. You need to re-import these countries to get the correct city names."
    2424msgstr ""
    2525
    26 #: ACF_City_Selector.php:169
     26#: ACF_City_Selector.php:167
    2727#, php-format
    2828msgid "cities in %s"
    2929msgstr ""
    3030
    31 #: ACF_City_Selector.php:169
     31#: ACF_City_Selector.php:167
    3232msgid "cities in Belgium and Netherlands"
    3333msgstr ""
    3434
    35 #: ACF_City_Selector.php:261 ACF_City_Selector.php:278
    36 #: ACF_City_Selector.php:386
     35#: ACF_City_Selector.php:259 ACF_City_Selector.php:276
     36#: ACF_City_Selector.php:384
    3737msgid "Settings"
    3838msgstr ""
    3939
    40 #: ACF_City_Selector.php:277
     40#: ACF_City_Selector.php:275
    4141msgid "Dashboard"
    4242msgstr ""
    4343
    44 #: ACF_City_Selector.php:281 ACF_City_Selector.php:388
     44#: ACF_City_Selector.php:279 ACF_City_Selector.php:386
    4545#: admin/acfcs-search.php:148
    4646msgid "Search"
    4747msgstr ""
    4848
    49 #: ACF_City_Selector.php:284
     49#: ACF_City_Selector.php:282
    5050msgid "Preview"
    5151msgstr ""
    5252
    53 #: ACF_City_Selector.php:287 ACF_City_Selector.php:389 admin/acfcs-info.php:26
     53#: ACF_City_Selector.php:285 ACF_City_Selector.php:387 admin/acfcs-info.php:26
    5454msgid "Info"
    5555msgstr ""
    5656
    57 #: ACF_City_Selector.php:290
     57#: ACF_City_Selector.php:288
    5858msgid "Get more countries"
    5959msgstr ""
    6060
    61 #: ACF_City_Selector.php:312
     61#: ACF_City_Selector.php:310
    6262#, php-format
    6363msgid "\"%s\" is not activated. This plugin <strong>must</strong> be activated, because without it \"%s\" won't work. Activate it <a href=\"%s\">here</a>."
    6464msgstr ""
    6565
    66 #: ACF_City_Selector.php:334
     66#: ACF_City_Selector.php:332
    6767#, php-format
    6868msgid "%s: The \"%s\" plugin will probably not work properly (anymore) with %s v4.x. Please upgrade to PRO."
    6969msgstr ""
    7070
    71 #: ACF_City_Selector.php:335
     71#: ACF_City_Selector.php:333
    7272msgid "Warning"
    7373msgstr ""
    7474
    75 #: ACF_City_Selector.php:385 admin/acfcs-preview.php:36
     75#: ACF_City_Selector.php:383 admin/acfcs-preview.php:36
    7676msgid "Preview data"
    7777msgstr ""
    7878
    79 #: ACF_City_Selector.php:387 admin/acfcs-countries.php:50
     79#: ACF_City_Selector.php:385 admin/acfcs-countries.php:50
    8080msgid "Get countries"
    8181msgstr ""
    8282
    83 #: admin/acf-city-selector-v4.php:29 admin/acf-city-selector-v5.php:34
     83#: admin/acf-city-selector-v4.php:31 admin/acf-city-selector-v5.php:34
    8484msgid "Choice"
    8585msgstr ""
    8686
    87 #: admin/acf-city-selector-v4.php:64 admin/acf-city-selector-v5.php:102
     87#: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:102
    8888msgid "All fields [default]"
    8989msgstr ""
    9090
    91 #: admin/acf-city-selector-v4.php:65 admin/acf-city-selector-v5.php:103
     91#: admin/acf-city-selector-v4.php:69 admin/acf-city-selector-v5.php:103
    9292msgid "Country only"
    9393msgstr ""
    9494
    95 #: admin/acf-city-selector-v4.php:66 admin/acf-city-selector-v5.php:104
     95#: admin/acf-city-selector-v4.php:70 admin/acf-city-selector-v5.php:104
    9696msgid "Country + State/province"
    9797msgstr ""
    9898
    99 #: admin/acf-city-selector-v4.php:67 admin/acf-city-selector-v5.php:105
     99#: admin/acf-city-selector-v4.php:71 admin/acf-city-selector-v5.php:105
    100100msgid "Country + City"
    101101msgstr ""
    102102
    103 #: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:106
     103#: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:106
    104104msgid "State/province + City"
    105105msgstr ""
    106106
    107 #: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:59
     107#: admin/acf-city-selector-v4.php:76 admin/acf-city-selector-v5.php:59
    108108#: admin/acfcs-info.php:170
    109109msgid "Yes"
    110110msgstr ""
    111111
    112 #: admin/acf-city-selector-v4.php:73 admin/acf-city-selector-v5.php:60
     112#: admin/acf-city-selector-v4.php:77 admin/acf-city-selector-v5.php:60
    113113#: admin/acfcs-info.php:170
    114114msgid "No"
    115115msgstr ""
    116116
    117 #: admin/acf-city-selector-v4.php:80 admin/acf-city-selector-v5.php:65
     117#: admin/acf-city-selector-v4.php:84 admin/acf-city-selector-v5.php:65
    118118msgid "Show labels"
    119119msgstr ""
    120120
    121 #: admin/acf-city-selector-v4.php:81 admin/acf-city-selector-v5.php:64
     121#: admin/acf-city-selector-v4.php:85 admin/acf-city-selector-v5.php:64
    122122msgid "Show field labels above the dropdown menus"
    123123msgstr ""
    124124
    125 #: admin/acf-city-selector-v4.php:97 admin/acf-city-selector-v5.php:96
     125#: admin/acf-city-selector-v4.php:101 admin/acf-city-selector-v5.php:96
    126126msgid "Default country"
    127127msgstr ""
    128128
    129 #: admin/acf-city-selector-v4.php:98 admin/acf-city-selector-v5.php:95
     129#: admin/acf-city-selector-v4.php:102 admin/acf-city-selector-v5.php:95
    130130msgid "Select a default country for a new field"
    131131msgstr ""
    132132
    133 #: admin/acf-city-selector-v4.php:114 admin/acf-city-selector-v5.php:111
     133#: admin/acf-city-selector-v4.php:118 admin/acf-city-selector-v5.php:111
    134134msgid "Fields to use"
    135135msgstr ""
    136136
    137 #: admin/acf-city-selector-v4.php:115 admin/acf-city-selector-v5.php:110
     137#: admin/acf-city-selector-v4.php:119 admin/acf-city-selector-v5.php:110
    138138msgid "Select which fields are used"
    139139msgstr ""
    140140
    141 #: admin/acf-city-selector-v4.php:178 admin/acf-city-selector-v5.php:160
     141#: admin/acf-city-selector-v4.php:184 admin/acf-city-selector-v5.php:160
    142142msgid "You haven't set a default country, so NO provinces/states and cities will be loaded."
    143143msgstr ""
     
    210210
    211211#: admin/acfcs-countries.php:66 admin/acfcs-search.php:172
    212 #: inc/acfcs-functions.php:774 inc/acfcs-help-tabs.php:46
     212#: inc/acfcs-functions.php:749 inc/acfcs-help-tabs.php:46
    213213msgid "Country"
    214214msgstr ""
     
    503503
    504504#: admin/acfcs-search.php:68 admin/acfcs-search.php:71
    505 #: inc/acfcs-functions.php:21 inc/acfcs-functions.php:506
    506 #: inc/acfcs-functions.php:928
     505#: inc/acfcs-functions.php:21 inc/acfcs-functions.php:477
     506#: inc/acfcs-functions.php:895
    507507msgid "Select a country"
    508508msgstr ""
     
    513513
    514514#: admin/acfcs-search.php:89 admin/acfcs-search.php:93
    515 #: inc/acfcs-functions.php:59 inc/acfcs-functions.php:513
    516 #: inc/acfcs-functions.php:930
     515#: inc/acfcs-functions.php:59 inc/acfcs-functions.php:484
     516#: inc/acfcs-functions.php:897
    517517msgid "Select a province/state"
    518518msgstr ""
     
    535535
    536536#: admin/acfcs-search.php:136 admin/acfcs-search.php:170
    537 #: inc/acfcs-functions.php:770 inc/acfcs-help-tabs.php:26
     537#: inc/acfcs-functions.php:745 inc/acfcs-help-tabs.php:26
    538538msgid "City"
    539539msgstr ""
    540540
    541541#: admin/acfcs-search.php:137 admin/acfcs-search.php:171
    542 #: inc/acfcs-functions.php:772 inc/acfcs-help-tabs.php:36
     542#: inc/acfcs-functions.php:747 inc/acfcs-help-tabs.php:36
    543543msgid "State"
    544544msgstr ""
     
    598598msgstr ""
    599599
    600 #: admin/acfcs-settings.php:64 admin/acfcs-settings.php:66
    601 msgid "Delete transients"
     600#: admin/acfcs-settings.php:64
     601msgid "Clear the database"
    602602msgstr ""
    603603
    604604#: admin/acfcs-settings.php:65
    605 msgid "If you're seeing unexpected results in your dropdowns, try clearing all transients with this option."
     605msgid "By selecting this option, you will remove all cities, which are present in the database. This is useful if you don't need the preset cities or you want a fresh start."
     606msgstr ""
     607
     608#: admin/acfcs-settings.php:66
     609msgid "Delete everything"
    606610msgstr ""
    607611
    608612#: admin/acfcs-settings.php:73
    609 msgid "Clear the database"
     613msgid "Delete data"
    610614msgstr ""
    611615
    612616#: admin/acfcs-settings.php:74
    613 msgid "By selecting this option, you will remove all cities, which are present in the database. This is useful if you don't need the preset cities or you want a fresh start."
    614 msgstr ""
    615 
    616 #: admin/acfcs-settings.php:75
    617 msgid "Delete everything"
    618 msgstr ""
    619 
    620 #: admin/acfcs-settings.php:82
    621 msgid "Delete data"
    622 msgstr ""
    623 
    624 #: admin/acfcs-settings.php:83
    625617msgid "When the plugin is deleted, all cities are not automatically deleted. Select this option to delete the cities table as well upon deletion."
    626618msgstr ""
    627619
    628 #: admin/acfcs-settings.php:88 admin/acfcs-settings.php:89
     620#: admin/acfcs-settings.php:79 admin/acfcs-settings.php:80
    629621msgid "Remove cities table on plugin deletion"
    630622msgstr ""
    631623
    632 #: admin/acfcs-settings.php:93
     624#: admin/acfcs-settings.php:84
    633625msgid "Save settings"
    634626msgstr ""
     
    705697msgstr ""
    706698
    707 #: inc/acfcs-functions.php:114 inc/acfcs-functions.php:504
    708 #: inc/acfcs-functions.php:927
     699#: inc/acfcs-functions.php:105 inc/acfcs-functions.php:475
     700#: inc/acfcs-functions.php:894
    709701msgid "Select a city"
    710702msgstr ""
    711703
    712 #: inc/acfcs-functions.php:300 inc/acfcs-functions.php:305
     704#: inc/acfcs-functions.php:271 inc/acfcs-functions.php:276
    713705msgid "Since your file is not accurate anymore, the file is deleted."
    714706msgstr ""
    715707
    716 #: inc/acfcs-functions.php:301
     708#: inc/acfcs-functions.php:272
    717709#, php-format
    718710msgid "There are too few columns on line %d. %s"
    719711msgstr ""
    720712
    721 #: inc/acfcs-functions.php:309
     713#: inc/acfcs-functions.php:280
    722714#, php-format
    723715msgid "There are too many columns on line %d. %s"
    724716msgstr ""
    725717
    726 #: inc/acfcs-functions.php:380
     718#: inc/acfcs-functions.php:351
    727719#, php-format
    728720msgid "There are too few columns on line %d."
    729721msgstr ""
    730722
    731 #: inc/acfcs-functions.php:385
     723#: inc/acfcs-functions.php:356
    732724#, php-format
    733725msgid "There are too many columns on line %d."
    734726msgstr ""
    735727
    736 #: inc/acfcs-functions.php:396
     728#: inc/acfcs-functions.php:367
    737729#, php-format
    738730msgid "The length of the country abbreviation on line %d is incorrect."
    739731msgstr ""
    740732
    741 #: inc/acfcs-functions.php:601
     733#: inc/acfcs-functions.php:572
    742734#, php-format
    743735msgid "Congratulations, there appear to be no errors in CSV file: \"%s\"."
    744736msgstr ""
    745737
    746 #: inc/acfcs-functions.php:642 inc/acfcs-functions.php:644
     738#: inc/acfcs-functions.php:613 inc/acfcs-functions.php:615
    747739#, php-format
    748740msgid "You have successfully imported %d cities from \"%s\"."
    749741msgstr ""
    750742
    751 #: inc/acfcs-functions.php:674
     743#: inc/acfcs-functions.php:645
    752744#, php-format
    753745msgid "Congratulations, you imported 1 city."
     
    756748msgstr[1] ""
    757749
    758 #: inc/acfcs-functions.php:680 inc/form-handling.php:33
     750#: inc/acfcs-functions.php:651 inc/form-handling.php:33
    759751msgid "You didn't select a file."
    760752msgstr ""
    761753
    762 #: inc/acfcs-functions.php:694
     754#: inc/acfcs-functions.php:665
    763755#, php-format
    764756msgid "File \"%s\" successfully deleted."
    765757msgstr ""
    766758
    767 #: inc/acfcs-functions.php:697
     759#: inc/acfcs-functions.php:668
    768760#, php-format
    769761msgid "File \"%s\" is not deleted. Please try again."
    770762msgstr ""
    771763
    772 #: inc/acfcs-functions.php:734
     764#: inc/acfcs-functions.php:712
    773765#, php-format
    774766msgid "You have successfully removed all entries for %s."
    775767msgstr ""
    776768
    777 #: inc/acfcs-functions.php:771 inc/acfcs-help-tabs.php:31
     769#: inc/acfcs-functions.php:746 inc/acfcs-help-tabs.php:31
    778770msgid "State code"
    779771msgstr ""
    780772
    781 #: inc/acfcs-functions.php:773 inc/acfcs-help-tabs.php:41
     773#: inc/acfcs-functions.php:748 inc/acfcs-help-tabs.php:41
    782774msgid "Country code"
    783775msgstr ""
    784776
    785 #: inc/acfcs-functions.php:926
     777#: inc/acfcs-functions.php:893
    786778msgid "No countries"
    787779msgstr ""
    788780
    789 #: inc/acfcs-functions.php:929
     781#: inc/acfcs-functions.php:896
    790782msgid "No results (yet), first select a country"
    791783msgstr ""
    792784
    793 #: inc/acfcs-functions.php:931
     785#: inc/acfcs-functions.php:898
    794786msgid "No results (yet), first select a state"
    795787msgstr ""
     
    990982#: inc/form-handling.php:8 inc/form-handling.php:30 inc/form-handling.php:64
    991983#: inc/form-handling.php:88 inc/form-handling.php:109 inc/form-handling.php:143
    992 #: inc/form-handling.php:159 inc/form-handling.php:178
    993 #: inc/form-handling.php:198
     984#: inc/form-handling.php:162 inc/form-handling.php:182
    994985msgid "Something went wrong, please try again."
    995986msgstr ""
     
    10191010msgstr[1] ""
    10201011
    1021 #: inc/form-handling.php:146
    1022 msgid "You have successfully deleted all transients."
    1023 msgstr ""
    1024 
    1025 #: inc/form-handling.php:164
     1012#: inc/form-handling.php:148
    10261013msgid "All cities are deleted."
    10271014msgstr ""
    10281015
    1029 #: inc/form-handling.php:185
     1016#: inc/form-handling.php:169
    10301017msgid "Settings saved"
    10311018msgstr ""
  • acf-city-selector/tags/1.14.0/readme.txt

    r3074624 r3133754  
    44Requires at least: 3.6.0
    55Requires PHP: 7.0
    6 Tested up to: 6.5.2
    7 Stable tag: 1.13.0
     6Tested up to: 6.6.1
     7Stable tag: 1.14.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4242== Changelog ==
    4343
     44= 1.14.0 =
     45* update database queries for searching citites in admin
     46* update database queries for deleting countries in admin
     47* removed transients because it conflicted with translation
     48
    4449= 1.13.0 =
    4550* Fix typo in function call
  • acf-city-selector/trunk/ACF_City_Selector.php

    r3074624 r3133754  
    44    Plugin URI:     https://acf-city-selector.com
    55    Description:    An extension for ACF which allows you to select a city based on country and province/state.
    6     Version:        1.13.0
    7     Tested up to:   6.5.2
     6    Version:        1.14.0
     7    Tested up to:   6.6.1
    88    Requires PHP:   7.0
    99    Author:         Beee
     
    3232             */
    3333            public function __construct() {
    34 
    35                 $this->settings = array(
     34               
     35                $this->settings = [
    3636                    'db_version' => '1.0',
    3737                    'url'        => plugin_dir_url( __FILE__ ),
    38                     'version'    => '1.13.0',
    39                 );
    40 
     38                    'version'    => '1.14.0',
     39                ];
     40               
    4141                if ( ! class_exists( 'ACFCS_WEBSITE_URL' ) ) {
    4242                    define( 'ACFCS_WEBSITE_URL', 'https://acf-city-selector.com' );
     
    4747                    define( 'ACFCS_PLUGIN_PATH', $plugin_path );
    4848                }
    49 
    50                 register_activation_hook( __FILE__,             array( $this, 'acfcs_plugin_activation' ) );
    51                 register_deactivation_hook( __FILE__,           array( $this, 'acfcs_plugin_deactivation' ) );
    52 
    53                 add_action( 'acf/register_fields',                  array( $this, 'acfcs_include_field_types' ) ); // v4
    54                 add_action( 'acf/include_field_types',              array( $this, 'acfcs_include_field_types' ) ); // v5
    55 
    56                 add_action( 'admin_enqueue_scripts',                array( $this, 'acfcs_add_scripts' ) );
    57                 add_action( 'wp_enqueue_scripts',                   array( $this, 'acfcs_add_scripts' ) );
    58 
    59                 add_action( 'admin_menu',                           array( $this, 'acfcs_add_admin_pages' ) );
    60                 add_action( 'admin_init',                           array( $this, 'acfcs_admin_menu' ) );
    61                 add_action( 'admin_init',                           array( $this, 'acfcs_errors' ) );
    62                 add_action( 'admin_init',                           array( $this, 'acfcs_check_table' ) );
    63                 add_action( 'admin_notices',                        array( $this, 'acfcs_check_cities' ) );
    64                 add_action( 'init',                                 array( $this, 'acfcs_load_textdomain' ) );
    65                 add_action( 'plugins_loaded',                       array( $this, 'acfcs_change_plugin_order' ), 5 );
    66                 add_action( 'plugins_loaded',                       array( $this, 'acfcs_check_for_acf' ), 6 );
    67                 add_action( 'plugins_loaded',                       array( $this, 'acfcs_check_acf_version' ) );
    68 
    69                 add_action( 'acf/input/admin_l10n',                 array( $this, 'acfcs_error_messages' ) );
    70 
    71                 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'acfcs_settings_link' ) );
    72 
     49               
     50                register_activation_hook( __FILE__,     [ $this, 'acfcs_plugin_activation' ] );
     51                register_deactivation_hook( __FILE__,   [ $this, 'acfcs_plugin_deactivation' ] );
     52               
     53                add_action( 'acf/register_fields',      [ $this, 'acfcs_include_field_types' ] ); // v4
     54                add_action( 'acf/include_field_types',  [ $this, 'acfcs_include_field_types' ] ); // v5
     55               
     56                add_action( 'admin_enqueue_scripts',    [ $this, 'acfcs_add_scripts' ] );
     57                add_action( 'wp_enqueue_scripts',       [ $this, 'acfcs_add_scripts' ] );
     58               
     59                add_action( 'admin_menu',               [ $this, 'acfcs_add_admin_pages' ] );
     60                add_action( 'admin_init',               [ $this, 'acfcs_admin_menu' ] );
     61                add_action( 'admin_init',               [ $this, 'acfcs_errors' ] );
     62                add_action( 'admin_init',               [ $this, 'acfcs_check_table' ] );
     63                add_action( 'admin_notices',            [ $this, 'acfcs_check_cities' ] );
     64                add_action( 'init',                     [ $this, 'acfcs_load_textdomain' ] );
     65                add_action( 'plugins_loaded',           [ $this, 'acfcs_change_plugin_order' ], 5 );
     66                add_action( 'plugins_loaded',           [ $this, 'acfcs_check_for_acf' ], 6 );
     67                add_action( 'plugins_loaded',           [ $this, 'acfcs_check_acf_version' ] );
     68               
     69                add_action( 'acf/input/admin_l10n',     [ $this, 'acfcs_error_messages' ] );
     70               
     71                add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), [ $this, 'acfcs_settings_link' ] );
     72               
    7373                // functions & hooks
    7474                include 'inc/acfcs-actions.php';
     
    106106            public function acfcs_plugin_deactivation() {
    107107                delete_option( 'acfcs_db_version' );
    108                 // this hook is here because I didn't want to create a new hook for an existing action
    109                 do_action( 'acfcs_delete_transients' );
    110108                // other important stuff gets done in uninstall.php
    111109            }
     
    150148                }
    151149            }
    152 
    153 
    154             /**
    155             * Check if cities need to be re-imported
    156             *
    157             * @return void
    158             */
     150           
     151           
     152            /**
     153            * Check if cities need to be re-imported
     154            *
     155            * @return void
     156            */
    159157            public function acfcs_check_cities() {
    160                 if ( '1.7.0' < $this->settings[ 'version' ] && false == get_option( 'acfcs_city_update_1_8_0' ) ) {
    161                     $countries = [ 'nl', 'be' ];
    162                     foreach( $countries as $country_code ) {
    163                         if ( true === acfcs_has_cities( $country_code ) ) {
    164                             $reimport[] = $country_code;
    165                         }
    166                     }
    167                     if ( isset( $reimport ) ) {
    168                         $country_name = 1 === count( $reimport ) ? acfcs_get_country_name( $reimport[ 0 ] ) : false;
    169                         $notice       = sprintf( __( 'Several %s had broken ascii characters. You need to re-import these countries to get the correct city names.', 'acf-city-selector' ), _n( sprintf( __( 'cities in %s', 'acf-city-selector' ), $country_name ), __( 'cities in Belgium and Netherlands', 'acf-city-selector' ), count( $reimport ), 'acf-city-selector' ) );
    170                         echo sprintf( '<div class="notice notice-warning is-dismissible"><p>%s</p></div>', $notice );
    171                     } else {
    172                         update_option( 'acfcs_city_update_1_8_0', 'done' );
    173                     }
    174                 }
     158                if ( '1.7.0' < $this->settings[ 'version' ] && false == get_option( 'acfcs_city_update_1_8_0' ) ) {
     159                    $countries = [ 'nl', 'be' ];
     160                    foreach( $countries as $country_code ) {
     161                        if ( true === acfcs_has_cities( $country_code ) ) {
     162                            $reimport[] = $country_code;
     163                        }
     164                    }
     165                    if ( isset( $reimport ) ) {
     166                        $country_name = 1 === count( $reimport ) ? acfcs_get_country_name( $reimport[ 0 ] ) : false;
     167                        $notice       = sprintf( __( 'Several %s had broken ascii characters. You need to re-import these countries to get the correct city names.', 'acf-city-selector' ), _n( sprintf( __( 'cities in %s', 'acf-city-selector' ), $country_name ), __( 'cities in Belgium and Netherlands', 'acf-city-selector' ), count( $reimport ), 'acf-city-selector' ) );
     168                        echo sprintf( '<div class="notice notice-warning is-dismissible"><p>%s</p></div>', $notice );
     169                    } else {
     170                        update_option( 'acfcs_city_update_1_8_0', 'done' );
     171                    }
     172                }
    175173            }
    176174
     
    345343
    346344            public function acfcs_load_textdomain() {
    347                 load_plugin_textdomain( 'acf-city-selector', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     345                load_plugin_textdomain( 'acf-city-selector', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
    348346            }
    349347
  • acf-city-selector/trunk/admin/acf-city-selector-v4.php

    r2696652 r3133754  
    1313            var $settings, // will hold info such as dir / path
    1414                $defaults; // will hold default field options
    15 
    16 
    17             /*
    18             *  __construct
    19             *
    20             *  Set name / label needed for actions / filters
    21             *
    22             *  @since   3.6
    23             *  @date    23/01/13
    24             */
     15           
     16           
     17            /**
     18             * __construct
     19             *
     20             * Set name / label needed for actions / filters
     21             *
     22             * @since   3.6
     23             * @date    23/01/13
     24             *
     25             * @param $settings
     26             */
    2527            function __construct( $settings ) {
    2628
     
    4244
    4345
    44             /*
    45             *  create_options()
    46             *
    47             *  Create extra options for your field. This is rendered when editing a field.
    48             *  The value of $field['name'] can be used (like below) to save extra data to the $field
    49             *
    50             *  @type    action
    51             *  @since   3.6
    52             *  @date    23/01/13
    53             *
    54             *  @param   $field  - an array holding all the field's data
    55             */
     46            /**
     47             * create_options()
     48             *
     49             * Create extra options for your field. This is rendered when editing a field.
     50             * The value of $field['name'] can be used (like below) to save extra data to the $field
     51             *
     52             * @type    action
     53             * @since   3.6
     54             * @date    23/01/13
     55             *
     56             * @param $field
     57             *
     58             * @return void
     59             */
    5660            function create_options( $field ) {
    5761                $field = array_merge($this->defaults, $field);
     
    130134
    131135
    132             /*
    133             *  create_field()
    134             *
    135             *  Create the HTML interface for your field
    136             *
    137             *  @param   $field - an array holding all the field's data
    138             *
    139             *  @type    action
    140             *  @since   3.6
    141             *  @date    23/01/13
    142             */
     136            /**
     137             * create_field()
     138             *
     139             * Create the HTML interface for your field
     140             *
     141             * @type    action
     142             * @since   3.6
     143             * @date    23/01/13
     144             *
     145             * @param $field
     146             *
     147             * @return void
     148             */
    143149            function create_field( $field ) {
    144150                $field            = array_merge( $this->defaults, $field );
     
    197203
    198204
    199             /*
    200             *  input_admin_enqueue_scripts()
    201             *
    202             *  This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
    203             *  Use this action to add CSS + JavaScript to assist your create_field() action.
    204             *
    205             *  $info    https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
    206             *  @type    action
    207             *  @since   3.6
    208             *  @date    23/01/13
    209             *
    210             *  @TODO: DRY
    211             */
     205            /**
     206             * input_admin_enqueue_scripts()
     207             *
     208             * This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
     209             * Use this action to add CSS + JavaScript to assist your create_field() action.
     210             *
     211             * $info    https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
     212             * @type    action
     213             * @since   3.6
     214             * @date    23/01/13
     215             *
     216             * @return void
     217             *
     218             * @TODO: DRY
     219             */
    212220            function input_admin_enqueue_scripts() {
    213221
     
    265273
    266274
    267             /*
    268             * load_value()
    269             *
    270             * This filter is applied to the $value after it is loaded from the db
    271             *
    272             *  @type    filter
    273             *  @since   3.6
    274             *  @date    23/01/13
    275             *
    276             *  @param   $value - the value found in the database
    277             *  @param   $post_id - the $post_id from which the value was loaded
    278             *  @param   $field - the field array holding all the field options
    279             *
    280             *  @TODO: DRY
    281             *
    282             *  @return  $value - the value to be saved in the database
    283             */
     275            /**
     276             * load_value()
     277             *
     278             * This filter is applied to the $value after it is loaded from the db
     279             *
     280             * @type filter
     281             * @since   3.6
     282             * @date    23/01/13
     283             *
     284             * @param $value
     285             * @param $post_id
     286             * @param $field
     287             *
     288             * @return mixed
     289             *
     290             * @TODO: DRY
     291             */
    284292            function load_value( $value, $post_id, $field ) {
    285293                $state_code   = false;
     
    388396        }
    389397
    390 
    391398        // initialize
    392399        new acf_field_city_selector( $this->settings );
    393400
    394 
    395         // class_exists check
    396401    endif;
  • acf-city-selector/trunk/admin/acf-city-selector-v5.php

    r2906374 r3133754  
    6969                    'value'        => $field[ 'show_labels' ],
    7070                ) );
    71 
    72                 acf_render_field_setting( $field, array(
     71               
     72                acf_render_field_setting( $field, array(
    7373                    'choices'      => $select_options,
    7474                    'instructions' => esc_html__( 'Use select2 for dropdowns', 'acf-city-selector' ),
     
    124124             */
    125125            function render_field( $field ) {
    126                 $default_country  = ( isset( $field[ 'default_country' ] ) && ! empty( $field[ 'default_country' ] ) ) ? $field[ 'default_country' ] : false;
    127                 $prefill_cities   = [];
    128                 $prefill_states   = [];
    129                 $selected_country = ( isset( $field[ 'value' ][ 'countryCode' ] ) ) ? $field[ 'value' ][ 'countryCode' ] : false;
    130                 $selected_state   = ( isset( $field[ 'value' ][ 'stateCode' ] ) ) ? $field[ 'value' ][ 'stateCode' ] : false;
    131                 $selected_city    = ( isset( $field[ 'value' ][ 'cityName' ] ) ) ? $field[ 'value' ][ 'cityName' ] : false;
    132                 $show_first       = true;
    133                 $store_meta       = ( isset( $field[ 'store_meta' ] ) ) ? $field[ 'store_meta' ] : false;
    134                 $which_fields     = ( isset( $field[ 'which_fields' ] ) ) ? $field[ 'which_fields' ] : 'all';
    135 
    136                 if ( false !== $default_country && false == $selected_country ) {
     126                $default_country  = ( isset( $field[ 'default_country' ] ) && ! empty( $field[ 'default_country' ] ) ) ? $field[ 'default_country' ] : false;
     127                $prefill_cities   = [];
     128                $prefill_states   = [];
     129                $selected_country = ( isset( $field[ 'value' ][ 'countryCode' ] ) ) ? $field[ 'value' ][ 'countryCode' ] : false;
     130                $selected_state   = ( isset( $field[ 'value' ][ 'stateCode' ] ) ) ? $field[ 'value' ][ 'stateCode' ] : false;
     131                $selected_city    = ( isset( $field[ 'value' ][ 'cityName' ] ) ) ? $field[ 'value' ][ 'cityName' ] : false;
     132                $show_first       = true;
     133                $store_meta       = ( isset( $field[ 'store_meta' ] ) ) ? $field[ 'store_meta' ] : false;
     134                $which_fields     = ( isset( $field[ 'which_fields' ] ) ) ? $field[ 'which_fields' ] : 'all';
     135               
     136                if ( false !== $default_country && false == $selected_country ) {
    137137                    // New post with default country
    138138                    if ( in_array( $which_fields, [ 'all', 'country_state', 'state_city' ] ) ) {
     
    176176                    echo acfcs_render_dropdown( 'city', $field, $selected_city, $prefill_values );
    177177                }
    178                 if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) && $store_meta ) {
    179                     echo acfcs_render_hidden_field( 'store_meta', '1' );
     178                if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) && $store_meta ) {
     179                    echo acfcs_render_hidden_field( 'store_meta', '1' );
    180180                }
    181181            }
     
    238238                    }
    239239                }
    240 
     240               
    241241                if ( strlen( $country_code ) == 2 && false != $state_code ) {
    242242                    global $wpdb;
    243                     $table                  = $wpdb->prefix . 'cities';
    244                     $sql_query              = $wpdb->prepare( "SELECT country, state_name FROM {$table} WHERE country_code = %s AND state_code = %s", $country_code, $state_code );
    245                     $row                    = $wpdb->get_row( $sql_query );
    246                     $value[ 'stateCode' ]   = $state_code;
    247                     $value[ 'stateName' ]   = ( isset( $row->state_name ) ) ? $row->state_name : false;
    248                     $value[ 'countryName' ] = ( isset( $row->country ) ) ? $row->country : false;
     243                    $table                  = $wpdb->prefix . 'cities';
     244                    $sql_query              = $wpdb->prepare( "SELECT country, state_name FROM {$table} WHERE country_code = %s AND state_code = %s", $country_code, $state_code );
     245                    $row                    = $wpdb->get_row( $sql_query );
     246                    $value[ 'stateCode' ]   = $state_code;
     247                    $value[ 'stateName' ]   = ( isset( $row->state_name ) ) ? $row->state_name : false;
     248                    $value[ 'countryName' ] = ( isset( $row->country ) ) ? $row->country : false;
    249249                }
    250250
     
    325325                    }
    326326                }
    327 
    328                 if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) ) {
    329                     do_action( 'acfcs_store_meta', $value, $post_id );
    330                 }
     327               
     328                if ( ! isset( $field[ 'parent_layout' ] ) && ! isset( $field[ 'parent_repeater' ] ) ) {
     329                    do_action( 'acfcs_store_meta', $value, $post_id );
     330                }
    331331
    332332                return $value;
  • acf-city-selector/trunk/admin/acfcs-search.php

    r2791052 r3133754  
    113113
    114114                                    <div class="acfcs__search-criteria acfcs__search-criteria--search">
    115                                         <label for="acfcs_search" class="screen-reader-text"><?php esc_attr_e( 'Search term', 'acf-city-selector' ); ?></label>
     115                                        <label for="acfcs_search" class="screen-reader-text"><?php esc_attr_e( 'Search term', 'acf-city-selector' ); ?></label>
    116116                                        <input name="acfcs_search" id="acfcs_search" type="text" value="<?php if ( false != $searched_term ) { echo stripslashes( $searched_term ); } ?>" placeholder="<?php esc_html_e( 'City name', 'acf-city-selector' ); ?>">
    117117                                    </div>
     
    120120
    121121                                    <div class="acfcs__search-criteria acfcs__search-criteria--limit">
    122                                         <label for="acfcs_limit" class="screen-reader-text"><?php esc_attr_e( 'Limit', 'acf-city-selector' ); ?></label>
     122                                        <label for="acfcs_limit" class="screen-reader-text"><?php esc_attr_e( 'Limit', 'acf-city-selector' ); ?></label>
    123123                                        <input name="acfcs_limit" id="acfcs_limit" type="number" value="<?php if ( false != $selected_limit ) { echo $selected_limit; } ?>" placeholder="<?php esc_html_e( 'Limit', 'acf-city-selector' ); ?>">
    124124                                    </div>
     
    127127
    128128                                    <div class="acfcs__search-criteria acfcs__search-criteria--orderby">
    129                                         <label for="acfcs_orderby" class="screen-reader-text"><?php esc_attr_e( 'Order by', 'acf-city-selector' ); ?></label>
     129                                        <label for="acfcs_orderby" class="screen-reader-text"><?php esc_attr_e( 'Order by', 'acf-city-selector' ); ?></label>
    130130                                        <select name="acfcs_orderby" id="acfcs_orderby">
    131131                                            <option value="">
  • acf-city-selector/trunk/admin/acfcs-settings.php

    r2685642 r3133754  
    6161
    6262                        <form method="post" action="">
    63                             <input name="acfcs_delete_transients" value="<?php echo wp_create_nonce( 'acfcs-delete-transients-nonce' ); ?>" type="hidden" />
    64                             <?php echo sprintf( '<h2>%s</h2>', esc_html__( 'Delete transients', 'acf-city-selector' ) ); ?>
    65                             <?php echo sprintf( '<p>%s</p>', esc_html__( "If you're seeing unexpected results in your dropdowns, try clearing all transients with this option.", 'acf-city-selector' ) ); ?>
    66                             <input type="submit" class="button button-primary" value="<?php esc_html_e( "Delete transients", 'acf-city-selector' ); ?>" />
    67                         </form>
    68 
    69                         <br /><hr />
    70 
    71                         <form method="post" action="">
    7263                            <input name="acfcs_truncate_table_nonce" value="<?php echo wp_create_nonce( 'acfcs-truncate-table-nonce' ); ?>" type="hidden" />
    7364                            <?php echo sprintf( '<h2>%s</h2>', esc_html__( 'Clear the database', 'acf-city-selector' ) ); ?>
  • acf-city-selector/trunk/admin/admin-right.php

    r2791052 r3133754  
    2525            echo sprintf( '<p>%s</p>', esc_html__( 'If you have some good suggestions for improvements and/or new features, please share them with us, maybe we can incorporate it.', 'acf-city-selector' ) );
    2626        ?>
    27 
    2827    </div>
    2928</div>
  • acf-city-selector/trunk/inc/acfcs-actions.php

    r3074624 r3133754  
    11<?php
    22    /**
    3      * Function to delete transients
     3     * Do stuff after certain imports
    44     *
    5      * @param false $country_code
     5     * @param $country_code
     6     *
     7     * @return void
    68     */
    7     function acfcs_delete_transients( $country_code = false ) {
    8         if ( false != $country_code ) {
    9             delete_transient( 'acfcs_states_' . strtolower( $country_code ) );
    10 
    11             // get states for country code
    12             $states = acfcs_get_states( $country_code );
    13             foreach( $states as $key => $state ) {
    14                 $country_code_with_state = strtolower( $key );
    15                 delete_transient( 'acfcs_cities_' . $country_code_with_state );
    16             }
     9    function acfcs_reimport_cities( $country_code = false ) {
     10        if ( $country_code && in_array( $country_code, [ 'nl', 'be' ] ) ) {
     11            update_option( 'acfcs_city_update_1_8_0_' . $country_code, 'done' );
    1712           
    18         } else {
    19             delete_transient( 'acfcs_countries' );
    20             $countries = acfcs_get_countries( false, false, true );
    21 
    22             if ( ! empty( $countries ) ) {
    23                 foreach( $countries as $country_code => $label ) {
    24                     do_action( 'acfcs_delete_transients', $country_code );
    25                     delete_transient( sprintf( 'acfcs_states_%s', $country_code ) );
    26                 }
     13            $belgium_done     = get_option( 'acfcs_city_update_1_8_0_be' );
     14            $netherlands_done = get_option( 'acfcs_city_update_1_8_0_nl' );
     15           
     16            if ( $belgium_done && $netherlands_done ) {
     17                delete_option( 'acfcs_city_update_1_8_0_be' );
     18                delete_option( 'acfcs_city_update_1_8_0_nl' );
     19                update_option( 'acfcs_city_update_1_8_0', 'done' );
    2720            }
    2821        }
    2922    }
    30     add_action( 'acfcs_delete_transients', 'acfcs_delete_transients' );
    31     add_action( 'acfcs_after_success_import', 'acfcs_delete_transients' );
    32     add_action( 'acfcs_after_success_import_raw', 'acfcs_delete_transients' );
    33     add_action( 'acfcs_after_success_nuke', 'acfcs_delete_transients' );
    34 
    35 
    36     /**
    37      * Do stuff after certain imports
    38      *
    39      * @param $country_code
    40      *
    41      * @return void
    42      */
    43     function acfcs_reimport_cities( $country_code = false ) {
    44         if ( $country_code && in_array( $country_code, [ 'nl', 'be' ] ) ) {
    45             update_option( 'acfcs_city_update_1_8_0_' . $country_code, 'done' );
    46 
    47             $belgium_done     = get_option( 'acfcs_city_update_1_8_0_be' );
    48             $netherlands_done = get_option( 'acfcs_city_update_1_8_0_nl' );
    49 
    50             if ( $belgium_done && $netherlands_done ) {
    51                 delete_option( 'acfcs_city_update_1_8_0_be' );
    52                 delete_option( 'acfcs_city_update_1_8_0_nl' );
    53                 update_option( 'acfcs_city_update_1_8_0', 'done' );
    54             }
    55         }
    56     }
    57     add_action( 'acfcs_after_success_import', 'acfcs_reimport_cities' );
    58 
    59 
    60     /**
    61      * Save location as single meta values
    62      *
    63      * @param $value
    64      * @param $post_id
    65      *
    66      * @return void
    67      */
    68     function acfcs_save_single_meta( $value, $post_id ) {
    69         if ( isset( $_POST[ 'store_meta' ] ) && 1 == $_POST[ 'store_meta' ] ) {
    70             if ( ! empty( $value[ 'countryCode' ] ) ) {
    71                 update_post_meta( $post_id, 'acfcs_search_country', $value[ 'countryCode' ] );
    72             }
    73             if ( ! empty( $value[ 'stateCode' ] ) ) {
    74                 update_post_meta( $post_id, 'acfcs_search_state', $value[ 'stateCode' ] );
    75             }
    76             if ( ! empty( $value[ 'cityName' ] ) ) {
    77                 update_post_meta( $post_id, 'acfcs_search_city', $value[ 'cityName' ] );
    78             }
    79         } elseif ( $post_id ) {
    80             // remove meta
    81             delete_post_meta( $post_id, 'acfcs_search_country' );
    82             delete_post_meta( $post_id, 'acfcs_search_state' );
    83             delete_post_meta( $post_id, 'acfcs_search_city' );
    84         }
    85     }
    86     add_action( 'acfcs_store_meta', 'acfcs_save_single_meta', 10, 2 );
     23    add_action( 'acfcs_after_success_import', 'acfcs_reimport_cities' );
     24   
     25   
     26    /**
     27     * Save location as single meta values
     28     *
     29     * @param $value
     30     * @param $post_id
     31     *
     32     * @return void
     33     */
     34    function acfcs_save_single_meta( $value, $post_id ) {
     35        if ( isset( $_POST[ 'store_meta' ] ) && 1 == $_POST[ 'store_meta' ] ) {
     36            if ( ! empty( $value[ 'countryCode' ] ) ) {
     37                update_post_meta( $post_id, 'acfcs_search_country', $value[ 'countryCode' ] );
     38            }
     39            if ( ! empty( $value[ 'stateCode' ] ) ) {
     40                update_post_meta( $post_id, 'acfcs_search_state', $value[ 'stateCode' ] );
     41            }
     42            if ( ! empty( $value[ 'cityName' ] ) ) {
     43                update_post_meta( $post_id, 'acfcs_search_city', $value[ 'cityName' ] );
     44            }
     45        } elseif ( $post_id ) {
     46            // remove meta
     47            delete_post_meta( $post_id, 'acfcs_search_country' );
     48            delete_post_meta( $post_id, 'acfcs_search_state' );
     49            delete_post_meta( $post_id, 'acfcs_search_city' );
     50        }
     51    }
     52    add_action( 'acfcs_store_meta', 'acfcs_save_single_meta', 10, 2 );
  • acf-city-selector/trunk/inc/acfcs-ajax.php

    r2841215 r3133754  
    2727                }
    2828            }
    29 
     29           
    3030            if ( ! isset( $field[ 'show_labels' ] ) && isset( $_POST[ 'show_labels' ] ) ) {
    31                 $field[ 'show_labels' ] = ( '1' == sanitize_text_field( $_POST[ 'show_labels' ] ) ) ? true : false;
    32             }
     31                $field[ 'show_labels' ] = ( '1' == sanitize_text_field( $_POST[ 'show_labels' ] ) ) ? true : false;
     32            }
    3333
    3434            if ( isset( $country_code ) ) {
     
    8080                }
    8181            }
    82 
     82           
    8383            if ( ! isset( $field[ 'show_labels' ] ) && isset( $_POST[ 'show_labels' ] ) ) {
    84                 $show_labels = sanitize_text_field( $_POST[ 'show_labels' ] );
    85                 if ( '1' == $show_labels ) {
    86                     $field[ 'show_labels' ] = true;
    87                 } elseif ( '0' == $show_labels ) {
    88                     $field[ 'show_labels' ] = false;
    89                 }
     84                $show_labels = sanitize_text_field( $_POST[ 'show_labels' ] );
     85                if ( '1' == $show_labels ) {
     86                    $field[ 'show_labels' ] = true;
     87                } elseif ( '0' == $show_labels ) {
     88                    $field[ 'show_labels' ] = false;
     89                }
    9090            }
    9191
  • acf-city-selector/trunk/inc/acfcs-functions.php

    r2841215 r3133754  
    1818     */
    1919    function acfcs_get_countries( $show_first = true, $field = false, $force = false ) {
    20         $countries            = array();
     20        $countries            = [];
    2121        $select_country_label = apply_filters( 'acfcs_select_country_label', esc_html__( 'Select a country', 'acf-city-selector' ) );
    2222        $show_labels          = ( isset( $field[ 'show_labels' ] ) ) ? $field[ 'show_labels' ] : true;
    23 
     23       
    2424        if ( $show_first ) {
    2525            $countries[ '' ] = '-';
     
    2828            }
    2929        }
    30 
    31         global $wpdb;
    32         $table   = $wpdb->prefix . 'cities';
    33         $results = $wpdb->get_results( "SELECT * FROM $table GROUP BY country ORDER BY country ASC" );
     30       
     31        global $wpdb;
     32        $table   = $wpdb->prefix . 'cities';
     33        $results = $wpdb->get_results( "SELECT * FROM $table GROUP BY country ORDER BY country ASC" );
    3434
    3535        if ( ! empty( $results ) ) {
    36             $country_results = array();
     36            $country_results = [];
    3737            foreach ( $results as $data ) {
    3838                if ( isset( $data->country_code ) && isset( $data->country ) ) {
     
    5959        $select_province_state_label = apply_filters( 'acfcs_select_province_state_label', esc_attr__( 'Select a province/state', 'acf-city-selector' ) );
    6060        $show_labels                 = ( isset( $field[ 'show_labels' ] ) ) ? $field[ 'show_labels' ] : true;
    61         $states                      = array();
    62 
     61        $states                      = [];
     62       
    6363        if ( $show_first ) {
    6464            if ( $show_labels ) {
     
    7070
    7171        if ( false != $country_code ) {
    72             $transient = get_transient( 'acfcs_states_' . strtolower( $country_code ) );
    73             if ( false == $transient || is_array( $transient ) && empty( $transient ) ) {
    74                 $order = ' ORDER BY state_name ASC';
    75                 if ( 'FR' == $country_code ) {
    76                     $order = " ORDER BY LENGTH(state_name), state_name";
    77                 }
    78 
    79                 global $wpdb;
    80                 $table   = $wpdb->prefix . 'cities';
    81                 $sql     = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s GROUP BY state_code" . $order, strtoupper( $country_code ) );
    82                 $results = $wpdb->get_results( $sql );
    83 
    84                 $state_results = array();
    85                 foreach ( $results as $data ) {
    86                     $state_results[ strtoupper( $country_code ) . '-' . $data->state_code ] = esc_attr__( $data->state_name, 'acf-city-selector' );
    87                 }
    88 
    89                 set_transient( 'acfcs_states_' . strtolower( $country_code ), $state_results, DAY_IN_SECONDS );
    90 
    91                 $states = array_merge( $states, $state_results );
    92 
    93             } else {
    94                 $states = array_merge( $states, $transient );
    95             }
     72            $order = ' ORDER BY state_name ASC';
     73            if ( 'FR' == $country_code ) {
     74                $order = " ORDER BY LENGTH(state_name), state_name";
     75            }
     76           
     77            global $wpdb;
     78            $table         = $wpdb->prefix . 'cities';
     79            $sql           = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s GROUP BY state_code" . $order, strtoupper( $country_code ) );
     80            $state_results = [];
     81            $results       = $wpdb->get_results( $sql );
     82           
     83            foreach ( $results as $data ) {
     84                $state_results[ strtoupper( $country_code ) . '-' . $data->state_code ] = esc_attr__( $data->state_name, 'acf-city-selector' );
     85            }
     86           
     87            $states = array_merge( $states, $state_results );
    9688        }
    9789
     
    110102     */
    111103    function acfcs_get_cities( $country_code = false, $state_code = false, $field = false ) {
    112         $cities            = array();
    113         $cities_transient  = false;
     104        $cities            = [];
    114105        $select_city_label = apply_filters( 'acfcs_select_city_label', esc_attr__( 'Select a city', 'acf-city-selector' ) );
    115         $set_transient     = false;
    116106        $show_labels       = ( isset( $field[ 'show_labels' ] ) ) ? $field[ 'show_labels' ] : true;
    117107
     
    122112        }
    123113
    124         if ( $country_code && ! $state_code ) {
    125             $cities_transient = get_transient( 'acfcs_cities_' . strtolower( $country_code ) );
    126         } elseif ( $country_code && $state_code ) {
    127             $cities_transient = get_transient( 'acfcs_cities_' . strtolower( $country_code ) . '-' . strtolower( $state_code ) );
    128         }
    129 
    130         if ( false == $cities_transient || empty( $cities_transient ) ) {
    131             $set_transient = true;
    132         } else {
    133             foreach ( $cities_transient as $data ) {
    134                 $city_array[ esc_attr__( $data, 'acf-city-selector' ) ] = esc_attr__( $data, 'acf-city-selector' );
     114        if ( $country_code ) {
     115            global $wpdb;
     116            $table = $wpdb->prefix . 'cities';
     117            $query = "SELECT * FROM $table";
     118           
     119            if ( $state_code ) {
     120                if ( 3 < strlen( $state_code ) ) {
     121                    $state_code = substr( $state_code, 3 );
     122                }
     123                $query = $wpdb->prepare( $query . " WHERE country_code = %s AND state_code = %s ORDER BY state_name, city_name ASC", $country_code, $state_code );
     124            } elseif ( $country_code ) {
     125                $query = $wpdb->prepare( $query . " WHERE country_code = %s", $country_code );
     126            }
     127           
     128            $city_results = [];
     129            $results      = $wpdb->get_results( $query );
     130           
     131            foreach ( $results as $data ) {
     132                $city_results[] = [
     133                    'city_name' => $data->city_name,
     134                ];
     135            }
     136
     137            if ( ! empty( $city_results ) ) {
     138                uasort( $city_results, 'acfcs_sort_array_with_quotes' );
     139            }
     140            foreach ( $city_results as $data ) {
     141                $city_array[ esc_attr__( $data[ 'city_name' ], 'acf-city-selector' ) ] = esc_attr__( $data[ 'city_name' ], 'acf-city-selector' );
    135142            }
    136143            if ( isset( $city_array ) ) {
     
    139146        }
    140147
    141         if ( $set_transient ) {
    142             if ( false !== $country_code ) {
    143                 global $wpdb;
    144                 $table = $wpdb->prefix . 'cities';
    145                 $query = "SELECT * FROM $table";
    146                 if ( $country_code && $state_code ) {
    147                     if ( 3 < strlen( $state_code ) ) {
    148                         $state_code = substr( $state_code, 3 );
    149                     }
    150                     $query = $wpdb->prepare( $query . " WHERE country_code = %s AND state_code = %s ORDER BY state_name, city_name ASC", $country_code, $state_code );
    151                 } elseif ( $country_code ) {
    152                     $query = $wpdb->prepare( $query . " WHERE country_code = %s", $country_code );
    153                 }
    154                 $city_results = array();
    155                 $results      = $wpdb->get_results( $query );
    156                 foreach ( $results as $data ) {
    157                     $city_results[] = [
    158                         'city_name' => $data->city_name,
    159                     ];
    160                 }
    161 
    162                 if ( ! empty( $city_results ) ) {
    163                     uasort( $city_results, 'acfcs_sort_array_with_quotes' );
    164                 }
    165                 foreach ( $city_results as $data ) {
    166                     $city_array[ esc_attr__( $data[ 'city_name' ], 'acf-city-selector' ) ] = esc_attr__( $data[ 'city_name' ], 'acf-city-selector' );
    167                 }
    168                 if ( isset( $city_array ) ) {
    169                     $cities = array_merge( $cities, $city_array );
    170                 }
    171                 if ( ! $state_code ) {
    172                     set_transient( 'acfcs_cities_' . strtolower( $country_code ), $city_array, DAY_IN_SECONDS );
    173                 } elseif ( $state_code ) {
    174                     set_transient( 'acfcs_cities_' . strtolower( $country_code ) . '-' . strtolower( $state_code ), $city_array, DAY_IN_SECONDS );
    175                 }
    176             }
    177         }
    178 
    179148        return $cities;
    180149    }
     
    190159    function acfcs_get_country_name( $country_code = false ) {
    191160        if ( false != $country_code ) {
    192             global $wpdb;
    193             $table   = $wpdb->prefix . 'cities';
    194             $query   = $wpdb->prepare( "SELECT country FROM $table WHERE country_code = %s", $country_code );
    195             $country = $wpdb->get_row( $query );
     161            global $wpdb;
     162            $table   = $wpdb->prefix . 'cities';
     163            $query   = $wpdb->prepare( "SELECT country FROM $table WHERE country_code = %s", $country_code );
     164            $country = $wpdb->get_row( $query );
    196165
    197166            if ( isset( $country->country ) ) {
     
    207176        return $country_code;
    208177    }
    209 
    210 
    211     /**
     178   
     179   
     180    /**
    212181     * Checks if there are any cities in the database (for page availability)
    213     *
    214     * @param $country_code
    215     *
    216     * @return bool
    217     */
     182    *
     183    * @param $country_code
     184    *
     185    * @return bool
     186    */
    218187    function acfcs_has_cities( $country_code = false ) {
    219188        global $wpdb;
    220         $table = $wpdb->prefix . 'cities';
    221         $query = "SELECT * FROM $table LIMIT 1";
    222         if ( $country_code ) {
    223             $query = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s LIMIT 1", $country_code );
    224         }
     189        $table = $wpdb->prefix . 'cities';
     190        $query = "SELECT * FROM $table LIMIT 1";
     191
     192        if ( $country_code ) {
     193            $query = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s LIMIT 1", $country_code );
     194        }
    225195
    226196        $results = $wpdb->get_results( $query );
     
    240210     */
    241211    function acfcs_check_if_files() {
    242         $actual_files = [];
    243         $target_dir   = acfcs_upload_folder();
    244 
    245         if ( is_dir( $target_dir ) ) {
     212        $actual_files = [];
     213        $target_dir   = acfcs_upload_folder();
     214       
     215        if ( is_dir( $target_dir ) ) {
    246216            $file_index = scandir( $target_dir );
    247             $excluded_files = [
     217            $default_excluded_files = [
    248218                '.',
    249219                '..',
     
    251221                'debug.json',
    252222            ];
    253 
     223            $excluded_files = apply_filters( 'acfcs_exclude_files', $default_excluded_files );
     224           
    254225            if ( is_array( $file_index ) ) {
    255226                foreach ( $file_index as $file ) {
     
    281252    function acfcs_csv_to_array( $file_name, $upload_folder = '', $delimiter = ';', $verify = false, $max_lines = false ) {
    282253        $upload_folder = ( ! empty( $upload_folder ) ) ? $upload_folder : acfcs_upload_folder( '/' );
    283         $csv_array     = array();
     254        $csv_array     = [];
    284255        $empty_array   = false;
    285256        $errors        = ACF_City_Selector::acfcs_errors();
    286         $new_array     = array();
    287 
     257        $new_array     = [];
     258       
    288259        if ( ( file_exists( $upload_folder . $file_name ) && $handle = fopen( $upload_folder . $file_name, "r" ) ) !== false ) {
    289260            $column_benchmark = 5;
     
    313284                if ( $errors->has_errors() ) {
    314285                    $empty_array = true;
    315                     $new_array   = array();
     286                    $new_array   = [];
    316287                } else {
    317288                    // create a new array for each row
    318                     $new_line = array();
     289                    $new_line = [];
    319290                    foreach ( $csv_line as $item ) {
    320291                        $new_line[] = $item;
     
    418389        $url     = ACFCS_WEBSITE_URL . '/wp-json/countries/v1/' . $endpoint;
    419390        $request = new WP_Http;
    420         $result  = $request->request( $url, array( 'method' => 'GET' ) );
     391        $result  = $request->request( $url, [ 'method' => 'GET' ] );
    421392        if ( 200 == $result[ 'response' ][ 'code' ] ) {
    422393            $response = json_decode( $result[ 'body' ] );
     
    425396        }
    426397
    427         return array();
     398        return [];
    428399    }
    429400
     
    436407    function acfcs_get_countries_info() {
    437408        global $wpdb;
    438         $table   = $wpdb->prefix . 'cities';
    439         $results = $wpdb->get_results( "SELECT country_code FROM $table GROUP BY country_code ORDER BY country_code ASC" );
    440 
    441         $acfcs_info = array();
     409        $acfcs_info = [];
     410        $table      = $wpdb->prefix . 'cities';
     411        $results    = $wpdb->get_results( "SELECT country_code FROM $table GROUP BY country_code ORDER BY country_code ASC" );
     412       
    442413        foreach ( $results as $data ) {
    443             $country_code = $data->country_code;
    444             $query        = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s ORDER BY country_code ASC", $country_code );
    445             $results      = $wpdb->get_results( $query );
     414            $country_code = $data->country_code;
     415            $query        = $wpdb->prepare( "SELECT * FROM $table WHERE country_code = %s ORDER BY country_code ASC", $country_code );
     416            $results      = $wpdb->get_results( $query );
    446417
    447418            $acfcs_info[ $country_code ] = [
     
    478449    function acfcs_custom_sort_with_quotes( $city ) {
    479450        // strip quote marks
    480         if ( strpos( $city, "'s" ) !== false ) {
    481             $city = trim( $city, '\'s ' );
    482             $city = preg_replace( '/^\s*\'s \s+/i', '', $city );
    483         } elseif ( strpos( $city, "'t" ) !== false ) {
    484             $city = trim( $city, '\'t ' );
    485             $city = preg_replace( '/^\s*\'t \s+/i', '', $city );
    486         }
     451        if ( strpos( $city, "'s" ) !== false ) {
     452            $city = trim( $city, '\'s ' );
     453            $city = preg_replace( '/^\s*\'s \s+/i', '', $city );
     454        } elseif ( strpos( $city, "'t" ) !== false ) {
     455            $city = trim( $city, '\'t ' );
     456            $city = preg_replace( '/^\s*\'t \s+/i', '', $city );
     457        }
    487458
    488459        return $city;
     
    578549        return $dropdown;
    579550    }
    580 
    581 
    582     function acfcs_render_hidden_field( $name, $value ) {
    583         if ( $name && $value ) {
    584             return sprintf( '<input type="hidden" name="%s" value="%s" />', $name, $value );
    585         }
    586 
    587         return false;
     551   
     552   
     553    function acfcs_render_hidden_field( $name, $value ) {
     554        if ( $name && $value ) {
     555            return sprintf( '<input type="hidden" name="%s" value="%s" />', $name, $value );
     556        }
     557       
     558        return false;
    588559    }
    589560
     
    626597                            foreach ( $csv_array[ 'data' ] as $line ) {
    627598                                $line_number++;
    628 
    629                                 $city_row = array(
     599                               
     600                                $city_row = [
    630601                                    'city_name'    => $line[ 0 ],
    631602                                    'state_code'   => $line[ 1 ],
     
    633604                                    'country_code' => $line[ 3 ],
    634605                                    'country'      => $line[ 4 ],
    635                                 );
    636 
     606                                ];
     607                               
    637608                                global $wpdb;
    638609                                $wpdb->insert( $wpdb->prefix . 'cities', $city_row );
     
    661632                foreach ( $verified_data as $line ) {
    662633                    $line_number++;
    663 
    664                     $city_row = array(
     634                   
     635                    $city_row = [
    665636                        'city_name'    => $line[ 0 ],
    666637                        'state_code'   => $line[ 1 ],
     
    668639                        'country_code' => $line[ 3 ],
    669640                        'country'      => $line[ 4 ],
    670                     );
    671 
     641                    ];
     642                   
    672643                    $wpdb->insert( $wpdb->prefix . 'cities', $city_row );
    673644                }
     
    709680    function acfcs_delete_country( $countries ) {
    710681        $country_names_and       = false;
    711         $sanitized_country_codes = array();
     682        $sanitized_country_codes = [];
     683       
    712684        foreach( $countries as $country_code ) {
    713             $sanitized_country_code    = sanitize_text_field( $country_code );
     685            $sanitized_country_code    = sanitize_text_field( strtoupper( $country_code ) );
    714686            $sanitized_country_codes[] = $sanitized_country_code;
    715687            $country_names[]           = acfcs_get_country_name( $sanitized_country_code );
    716688        }
     689       
    717690        if ( ! empty( $country_names ) ) {
    718691            $country_names_quotes = "'" . implode( "', '", $country_names ) . "'";
     
    725698
    726699        if ( ! empty( $sanitized_country_codes ) ) {
     700            if ( 1 === count( $sanitized_country_codes ) ) {
     701                $country_string = strtoupper( $sanitized_country_codes[ 0 ] );
     702            } else {
     703                $country_string = strtoupper( "'" . implode( "', '", $sanitized_country_codes ) . "'" );
     704            }
     705           
    727706            global $wpdb;
    728             $table          = $wpdb->prefix . 'cities';
    729             $country_string = strtoupper( "'" . implode( "', '", $sanitized_country_codes ) . "'" );
    730             $query          = $wpdb->prepare( "DELETE FROM $table WHERE `country_code` IN (%s)", $country_string );
    731             $result         = $wpdb->query( $query );
     707            $table = $wpdb->prefix . 'cities';
     708            $query  = $wpdb->prepare( "DELETE FROM $table WHERE country_code IN (%s)", $country_string );
     709            $result = $wpdb->query( $query );
    732710
    733711            if ( $result > 0 ) {
    734                 ACF_City_Selector::acfcs_errors()->add( 'success_country_remove', sprintf( esc_html__( 'You have successfully removed all entries for %s.', 'acf-city-selector' ), $country_names_and ) );
    735                 foreach( $countries as $country_code ) {
    736                     do_action( 'acfcs_delete_transients', $country_code );
    737                 }
     712                ACF_City_Selector::acfcs_errors()->add( 'success_country_remove', sprintf( esc_html__( 'You have successfully removed all entries for %s.', 'acf-city-selector' ), $country_names_and ) );
    738713            }
    739714        }
     
    766741    function acfcs_render_preview_results( $csv_data = [] ) {
    767742        $table = '';
    768         if ( ! empty( $csv_data ) ) {
     743        if ( ! empty( $csv_data ) ) {
    769744            $table_columns = [
    770745                esc_html__( 'City', 'acf-city-selector' ),
     
    793768            $table      = sprintf( '<table class="acfcs__table acfcs__table--preview-result scrollable">%s%s</table>', $table_headers, $table_body );
    794769        }
    795 
    796         return $table;
     770       
     771        return $table;
    797772    }
    798773
     
    807782    function acfcs_get_states_optgroup() {
    808783        $results = acfcs_get_countries( false );
    809         $states  = [];
     784        $states  = [];
    810785
    811786        // if there is at least 1 country
     
    820795            // get states for these countries
    821796            if ( ! empty( $countries ) ) {
    822                 global $wpdb;
    823                 $table = $wpdb->prefix . 'cities';
    824 
    825                 foreach ( $countries as $country ) {
    826                     $states[] = array(
     797                global $wpdb;
     798                $table = $wpdb->prefix . 'cities';
     799               
     800                foreach( $countries as $country ) {
     801                    $states[] = [
    827802                        'state' => 'open_optgroup',
    828803                        'name'  => esc_attr__( acfcs_get_country_name( $country[ 'code' ] ), 'acf-city-selector' ),
    829                     );
    830 
     804                    ];
     805                   
    831806                    $order = 'ORDER BY state_name ASC';
    832807                    if ( 'FR' == $country[ 'code' ] ) {
     
    840815                    if ( count( $results ) > 0 ) {
    841816                        foreach ( $results as $data ) {
    842                             $states[] = array(
     817                            $states[] = [
    843818                                'state' => strtolower( $data->country_code ) . '-' . strtolower( $data->state_code ),
    844819                                'name'  => esc_attr__( $data->state_name, 'acf-city-selector' ),
    845                             );
     820                            ];
    846821                        }
    847822                    }
    848 
    849                     $states[] = array(
     823                   
     824                    $states[] = [
    850825                        'state' => 'close_optgroup',
    851826                        'name'  => '',
    852                     );
    853                 }
    854             }
    855         }
    856 
    857         return $states;
     827                    ];
     828                }
     829            }
     830        }
     831       
     832        return $states;
    858833    }
    859834
     
    868843    function acfcs_get_searched_cities() {
    869844        global $wpdb;
     845        $orderby                 = false;
     846        $table                   = $wpdb->prefix . 'cities';
    870847        $search_criteria_state   = ( isset( $_POST[ 'acfcs_state' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_state' ] ) : false;
    871848        $search_criteria_country = ( isset( $_POST[ 'acfcs_country' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_country' ] ) : false;
    872         $search_limit            = false;
    873849        $searched_orderby        = ( ! empty( $_POST[ 'acfcs_orderby' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_orderby' ] ) : false;
    874850        $searched_term           = ( ! empty( $_POST[ 'acfcs_search' ] ) ) ? sanitize_text_field( $_POST[ 'acfcs_search' ] ) : false;
    875851        $selected_limit          = ( ! empty( $_POST[ 'acfcs_limit' ] ) ) ? (int) $_POST[ 'acfcs_limit' ] : 100;
    876         $where                   = array();
    877 
     852        $select                  = "SELECT * FROM $table WHERE";
     853       
    878854        if ( false != $search_criteria_state ) {
    879             $where[] = "state_code = '" . substr( $search_criteria_state, 3, 3) . "' AND country_code = '" . substr( $search_criteria_state, 0, 2) . "'";
     855            $select .= " state_code = '" . strtoupper( substr( $search_criteria_state, 3, 3 ) ) . "' AND country_code = '" . strtoupper( substr( $search_criteria_state, 0, 2 ) ) . "'";
    880856        } elseif ( false != $search_criteria_country ) {
    881             $where[] = "country_code = '" . $search_criteria_country . "'";
    882         }
     857            $select .= sprintf( " country_code = '%s'", $search_criteria_country );
     858        }
     859       
    883860        if ( false != $searched_term ) {
    884             $search[] = 'city_name LIKE "%' . $searched_term . '%"';
     861            $search = ' AND city_name LIKE "%' . $searched_term . '%"';
    885862
    886863            if ( $search_criteria_country || $search_criteria_state ) {
    887                 $where[] = '(' . implode( ' OR ', $search ) . ')';
    888             } else {
    889                 $where[] = implode( ' OR ', $search );
    890             }
    891 
    892         }
     864                $select .= $search;
     865            }
     866        }
     867
     868        if ( 'state' == $searched_orderby ) {
     869            $select .= ' ORDER BY state_name ASC, city_name ASC';
     870        } else {
     871            $select .= ' ORDER BY city_name ASC, state_name ASC';
     872        }
     873
    893874        if ( 0 != $selected_limit ) {
    894             $search_limit = "LIMIT " . $selected_limit;
    895         }
    896 
    897         if ( ! empty( $where ) ) {
    898             $where   = "WHERE " . implode( ' AND ', $where );
    899         } else {
    900             $where = false;
    901         }
    902 
    903         if ( 'state' == $searched_orderby ) {
    904             $orderby = 'ORDER BY state_name ASC, city_name ASC';
    905         } else {
    906             $orderby = 'ORDER BY city_name ASC, state_name ASC';
    907         }
    908 
    909         $table  = $wpdb->prefix . 'cities';
    910         $query  = $wpdb->prepare( "SELECT * FROM $table %s %s %s", $where, $orderby, $search_limit );
    911         $cities = $wpdb->get_results( $query );
     875            $select .= " LIMIT " . $selected_limit;
     876        }
     877       
     878        $cities = $wpdb->get_results( $select );
    912879
    913880        return $cities;
     
    923890     */
    924891    function acfcs_get_js_translations() {
    925         $translations = array(
     892        $translations = [
    926893            'no_countries'         => esc_attr__( 'No countries', 'acf-city-selector' ),
    927894            'select_city'          => esc_attr( apply_filters( 'acfcs_select_city_label', __( 'Select a city', 'acf-city-selector' ) ) ),
     
    930897            'select_state'         => esc_attr( apply_filters( 'acfcs_select_province_state_label', __( 'Select a province/state', 'acf-city-selector' ) ) ),
    931898            'select_state_first'   => esc_attr( apply_filters( 'acfcs_select_state_first', __( 'No results (yet), first select a state', 'acf-city-selector' ) ) ),
    932         );
    933 
     899        ];
     900       
    934901        return $translations;
    935902    }
  • acf-city-selector/trunk/inc/form-handling.php

    r2841215 r3133754  
    119119                        }
    120120                    }
    121                     $cities  = implode( ', ', $cities );
    122                     $row_ids = implode( ',', $ids );
    123                     $table   = $wpdb->prefix . 'cities';
    124                     $query   = $wpdb->prepare( "DELETE FROM {$table} WHERE id IN (%s)", $row_ids );
    125                     $amount  = $wpdb->query( $query );
     121                    $cities  = implode( ', ', $cities );
     122                    $row_ids = implode( ',', $ids );
     123                    $table   = $wpdb->prefix . 'cities';
     124                    $query   = $wpdb->prepare( "DELETE FROM {$table} WHERE id IN (%s)", $row_ids );
     125                    $amount  = $wpdb->query( $query );
    126126
    127127                    if ( $amount > 0 ) {
     
    133133    }
    134134    add_action( 'admin_init', 'acfcs_delete_rows' );
    135 
    136 
    137     /**
    138      * Form to handle deleting of all transients
    139      */
    140     function acfcs_delete_all_transients() {
    141         if ( isset( $_POST[ 'acfcs_delete_transients' ] ) ) {
    142             if ( ! wp_verify_nonce( $_POST[ 'acfcs_delete_transients' ], 'acfcs-delete-transients-nonce' ) ) {
    143                 ACF_City_Selector::acfcs_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-city-selector' ) );
    144             } else {
    145                 do_action( 'acfcs_delete_transients' );
    146                 ACF_City_Selector::acfcs_errors()->add( 'success_transients_delete', esc_html__( 'You have successfully deleted all transients.', 'acf-city-selector' ) );
    147             }
    148         }
    149     }
    150     add_action( 'admin_init', 'acfcs_delete_all_transients' );
    151135
    152136
     
    201185                    if ( isset( $_POST[ 'acfcs_import_be' ] ) && 1 == $_POST[ 'acfcs_import_be' ] ) {
    202186                        acfcs_import_data( 'be.csv', ACFCS_PLUGIN_PATH . 'import/' );
    203                         do_action( 'acfcs_delete_transients', 'be' );
    204187                    }
    205188                    if ( isset( $_POST[ 'acfcs_import_nl' ] ) && 1 == $_POST[ 'acfcs_import_nl' ] ) {
    206189                        acfcs_import_data( 'nl.csv', ACFCS_PLUGIN_PATH . 'import/' );
    207                         do_action( 'acfcs_delete_transients', 'nl' );
    208190                    }
    209191                    do_action( 'acfcs_after_success_import' );
  • acf-city-selector/trunk/languages/acf-city-selector-de_DE.po

    r2841217 r3133754  
    33"Project-Id-Version: ACF City Selector\n"
    44"POT-Creation-Date: 2022-12-29 19:50+0100\n"
    5 "PO-Revision-Date: 2022-12-29 19:50+0100\n"
     5"PO-Revision-Date: 2024-08-08 23:57+0200\n"
    66"Last-Translator: Beee\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.4.3\n"
     12"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     13"X-Generator: Poedit 3.4.4\n"
    1314"X-Poedit-Basepath: ..\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1515"X-Poedit-KeywordsList: __;_e;_n;_n:1,2;_n_noop;_nx_noop;esc_html__;"
    1616"esc_html_e;esc_attr;esc_attr__;esc_attr_e;esc_html__;esc_html_e\n"
     
    2525"countries to get the correct city names."
    2626msgstr ""
     27"Mehrere %s hatten defekte ASCII-Zeichen. Du musst diese Länder neu "
     28"importieren um die korrekten Städtenamen zu erhalten."
    2729
    2830#: ACF_City_Selector.php:169
    29 #, fuzzy, php-format
    30 #| msgid "# cities"
     31#, php-format
    3132msgid "cities in %s"
    32 msgstr "# Städte"
     33msgstr "Städte in %s"
    3334
    3435#: ACF_City_Selector.php:169
    35 #, fuzzy
    36 #| msgid "Import all cities in Holland/The Netherlands"
    3736msgid "cities in Belgium and Netherlands"
    38 msgstr "Importiere alle Städte in Holland/Niederlande"
     37msgstr "Städte in Holland/Niederlande"
    3938
    4039#: ACF_City_Selector.php:261 ACF_City_Selector.php:278
     
    7574
    7675#: ACF_City_Selector.php:334
    77 #, fuzzy, php-format
    78 #| msgid ""
    79 #| "<b>Warning</b>: The \"%s\" plugin will probably not work properly "
    80 #| "(anymore) with %s v4.x. Please upgrade to PRO."
     76#, php-format
    8177msgid ""
    8278"%s: The \"%s\" plugin will probably not work properly (anymore) with %s v4."
    8379"x. Please upgrade to PRO."
    8480msgstr ""
    85 "<b>Warnung</b>: Das Plugin \"%s\" funktioniert warscheinlich leider nicht "
    86 "(mehr) ordnungsgemäß mit %s v4.x. Bitte aktualisiere auf die PRO Version."
     81"%s: Das Plugin \"%s\" funktioniert wahrscheinlich leider nicht (mehr) "
     82"ordnungsgemäß mit %s v4.x. Bitte aktualisiere auf die PRO Version."
    8783
    8884#: ACF_City_Selector.php:335
     
    174170#: admin/acf-city-selector-v5.php:84
    175171msgid "Store location as single meta values"
    176 msgstr ""
     172msgstr "Standort als einzelnen Meta Wert speichern"
    177173
    178174#: admin/acf-city-selector-v5.php:85
    179175msgid "Store meta"
    180 msgstr ""
     176msgstr "Meta speichern"
    181177
    182178#: admin/acf-city-selector-v5.php:352
     
    292288#: admin/acfcs-countries.php:149
    293289msgid "request"
    294 msgstr ""
     290msgstr "anfragen"
    295291
    296292#: admin/acfcs-countries.php:151
     
    310306"Max lines has no effect when verifying. The entire file will be checked."
    311307msgstr ""
     308"Max lines hat keinen Effekt bei der Verifizierung. Die gesamte Datei wird "
     309"geprüft werden."
    312310
    313311#: admin/acfcs-dashboard.php:43
     
    475473#: admin/acfcs-info.php:238
    476474msgid "left-click to open, right-click to save"
    477 msgstr ""
     475msgstr "Linksklick zum öffnen, Rechtsklick zum speichern"
    478476
    479477#: admin/acfcs-preview-form.php:6
     
    564562msgid "You haven't imported any cities yet. Import any files from your %s."
    565563msgstr ""
     564"Du hast noch keine Städte importiert. Importiere Dateien von deiner %s."
    566565
    567566#: admin/acfcs-search.php:68 admin/acfcs-search.php:71
     
    736735#, php-format
    737736msgid "%s for the plugin's official website."
    738 msgstr ""
     737msgstr "%s für die offizielle Plugin Webseite."
    739738
    740739#: admin/admin-right.php:13
    741740msgid "Click here"
    742 msgstr ""
     741msgstr "Klicke hier"
    743742
    744743#: admin/admin-right.php:17
     
    749748#, php-format
    750749msgid "If you need support for this plugin, please turn to %s."
    751 msgstr ""
     750msgstr "Wende dich an %s wenn du Hilfe für diesem Plugin benötigst."
    752751
    753752#: admin/admin-right.php:23
    754753msgid "Requests"
    755 msgstr ""
     754msgstr "Anfragen"
    756755
    757756#: admin/admin-right.php:25
    758 #, fuzzy
    759 #| msgid ""
    760 #| "If you need support for this plugin or if you have some good suggestions "
    761 #| "for improvements and/or new features, please turn to %s."
    762757msgid ""
    763758"If you have some good suggestions for improvements and/or new features, "
     
    781776#: admin/raw-input-form.php:8
    782777msgid "Raw CSV import"
    783 msgstr ""
     778msgstr "Roher CSV Import"
    784779
    785780#: admin/raw-input-form.php:12
     
    10101005"If you need more countries, you can get them on the official website: %s."
    10111006msgstr ""
     1007"Wenn du weitere Länder benötigst, kannst du diese auf der offiziellen "
     1008"Webseite herunterladen: %s."
    10121009
    10131010#: inc/acfcs-help-tabs.php:101
     
    10171014#: inc/acfcs-i18n.php:16
    10181015msgid "Andorra"
    1019 msgstr ""
     1016msgstr "Andorra"
    10201017
    10211018#: inc/acfcs-i18n.php:17
    10221019msgid "Aruba"
    1023 msgstr ""
     1020msgstr "Aruba"
    10241021
    10251022#: inc/acfcs-i18n.php:18
     
    10411038#: inc/acfcs-i18n.php:22
    10421039msgid "China"
    1043 msgstr ""
     1040msgstr "China"
    10441041
    10451042#: inc/acfcs-i18n.php:23
    10461043msgid "Curaçao"
    1047 msgstr ""
     1044msgstr "Curaçao"
    10481045
    10491046#: inc/acfcs-i18n.php:24
     
    10611058#: inc/acfcs-i18n.php:27
    10621059msgid "Grenada"
    1063 msgstr ""
     1060msgstr "Genada"
    10641061
    10651062#: inc/acfcs-i18n.php:28
     
    10731070#: inc/acfcs-i18n.php:30
    10741071msgid "Mexico"
    1075 msgstr ""
     1072msgstr "Mexiko"
    10761073
    10771074#: inc/acfcs-i18n.php:31
     
    10851082#: inc/acfcs-i18n.php:33
    10861083msgid "Portugal"
    1087 msgstr ""
     1084msgstr "Portugal"
    10881085
    10891086#: inc/acfcs-i18n.php:34
     
    11051102#: inc/acfcs-i18n.php:38
    11061103msgid "Uruguay"
    1107 msgstr ""
     1104msgstr "Uruguay"
    11081105
    11091106#: inc/acfcs-i18n.php:39
     
    12331230#, php-format
    12341231#~ msgid ""
    1235 #~ "<strong>!!!</strong> The default delimiters has been changed from "
    1236 #~ "',' (comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
     1232#~ "<strong>!!!</strong> The default delimiters has been changed from ',' "
     1233#~ "(comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
    12371234#~ msgstr ""
    12381235#~ "<strong>!!!</strong> Die Standardtrennzeichen wurden von ',' (Komma) in "
     
    13351332#~ msgstr ""
    13361333#~ "Vielen Dank für die Installation des 'City Selector' Plugins. Ich hoffe "
    1337 #~ "es gefällt dir. Bitte denke über <a href=\"%s\" rel=\"noopener\" target="
    1338 #~ "\"_blank\">eine Spende nach</a> wenn du das Plugin gefällt, damit ich das "
    1339 #~ "Plugin noch besser machen kann."
     1334#~ "es gefällt dir. Bitte denke über <a href=\"%s\" rel=\"noopener\" "
     1335#~ "target=\"_blank\">eine Spende nach</a> wenn du das Plugin gefällt, damit "
     1336#~ "ich das Plugin noch besser machen kann."
    13401337
    13411338#~ msgid "Admin email"
  • acf-city-selector/trunk/languages/acf-city-selector-nl_NL.po

    r2841217 r3133754  
    22msgstr ""
    33"Project-Id-Version: ACF City Selector 1.0\n"
    4 "POT-Creation-Date: 2022-12-29 19:49+0100\n"
    5 "PO-Revision-Date: 2022-12-29 19:50+0100\n"
     4"POT-Creation-Date: 2024-07-29 20:47+0200\n"
     5"PO-Revision-Date: 2024-07-29 20:47+0200\n"
    66"Last-Translator: Beee\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.4.3\n"
     12"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     13"X-Generator: Poedit 3.4.4\n"
    1314"X-Poedit-Basepath: ..\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    1515"X-Poedit-KeywordsList: __;_e;_x;_ex;_n;_nx;_n:1,2;_n_noop;_nx_noop;"
    1616"esc_html__;esc_html_e;esc_html_x;esc_attr__;esc_attr_e;esc_attr_x\n"
     
    1818"X-Poedit-SearchPathExcluded-0: languages\n"
    1919
    20 #: ACF_City_Selector.php:169
     20#: ACF_City_Selector.php:167
    2121#, php-format
    2222msgid ""
     
    2727"importeren om de correcte namen te krijgen."
    2828
    29 #: ACF_City_Selector.php:169
     29#: ACF_City_Selector.php:167
    3030#, php-format
    3131msgid "cities in %s"
    3232msgstr "steden in %s"
    3333
    34 #: ACF_City_Selector.php:169
     34#: ACF_City_Selector.php:167
    3535msgid "cities in Belgium and Netherlands"
    3636msgstr "steden in België en Nederland"
    3737
    38 #: ACF_City_Selector.php:261 ACF_City_Selector.php:278
    39 #: ACF_City_Selector.php:386
     38#: ACF_City_Selector.php:259 ACF_City_Selector.php:276
     39#: ACF_City_Selector.php:384
    4040msgid "Settings"
    4141msgstr "Instellingen"
    4242
    43 #: ACF_City_Selector.php:277
     43#: ACF_City_Selector.php:275
    4444msgid "Dashboard"
    4545msgstr "Dashboard"
    4646
    47 #: ACF_City_Selector.php:281 ACF_City_Selector.php:388
     47#: ACF_City_Selector.php:279 ACF_City_Selector.php:386
    4848#: admin/acfcs-search.php:148
    4949msgid "Search"
    5050msgstr "Zoeken"
    5151
    52 #: ACF_City_Selector.php:284
     52#: ACF_City_Selector.php:282
    5353msgid "Preview"
    5454msgstr "Preview"
    5555
    56 #: ACF_City_Selector.php:287 ACF_City_Selector.php:389 admin/acfcs-info.php:26
     56#: ACF_City_Selector.php:285 ACF_City_Selector.php:387 admin/acfcs-info.php:26
    5757msgid "Info"
    5858msgstr "Informatie"
    5959
    60 #: ACF_City_Selector.php:290
     60#: ACF_City_Selector.php:288
    6161msgid "Get more countries"
    6262msgstr "Meer landen"
    6363
    64 #: ACF_City_Selector.php:312
     64#: ACF_City_Selector.php:310
    6565#, php-format
    6666msgid ""
     
    7171"werkt \"%s\" niet. Activeer hem <a href=\"%s\">hier</a>."
    7272
    73 #: ACF_City_Selector.php:334
     73#: ACF_City_Selector.php:332
    7474#, php-format
    7575msgid ""
     
    8080"upgrade naar PRO."
    8181
    82 #: ACF_City_Selector.php:335
     82#: ACF_City_Selector.php:333
    8383msgid "Warning"
    8484msgstr "Waarschuwing"
    8585
    86 #: ACF_City_Selector.php:385 admin/acfcs-preview.php:36
     86#: ACF_City_Selector.php:383 admin/acfcs-preview.php:36
    8787msgid "Preview data"
    8888msgstr "Data bekijken"
    8989
    90 #: ACF_City_Selector.php:387 admin/acfcs-countries.php:50
     90#: ACF_City_Selector.php:385 admin/acfcs-countries.php:50
    9191msgid "Get countries"
    9292msgstr "Meer landen"
    9393
    94 #: admin/acf-city-selector-v4.php:29 admin/acf-city-selector-v5.php:34
     94#: admin/acf-city-selector-v4.php:31 admin/acf-city-selector-v5.php:34
    9595msgid "Choice"
    9696msgstr "Keuze"
    9797
    98 #: admin/acf-city-selector-v4.php:64 admin/acf-city-selector-v5.php:102
     98#: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:102
    9999msgid "All fields [default]"
    100100msgstr "Alle velden [standaard]"
    101101
    102 #: admin/acf-city-selector-v4.php:65 admin/acf-city-selector-v5.php:103
     102#: admin/acf-city-selector-v4.php:69 admin/acf-city-selector-v5.php:103
    103103msgid "Country only"
    104104msgstr "Alleen land"
    105105
    106 #: admin/acf-city-selector-v4.php:66 admin/acf-city-selector-v5.php:104
     106#: admin/acf-city-selector-v4.php:70 admin/acf-city-selector-v5.php:104
    107107msgid "Country + State/province"
    108108msgstr "Land + Staat/Provincies"
    109109
    110 #: admin/acf-city-selector-v4.php:67 admin/acf-city-selector-v5.php:105
     110#: admin/acf-city-selector-v4.php:71 admin/acf-city-selector-v5.php:105
    111111msgid "Country + City"
    112112msgstr "Land + Stad"
    113113
    114 #: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:106
     114#: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:106
    115115msgid "State/province + City"
    116116msgstr "Staat/Provincie + Stad"
    117117
    118 #: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:59
     118#: admin/acf-city-selector-v4.php:76 admin/acf-city-selector-v5.php:59
    119119#: admin/acfcs-info.php:170
    120120msgid "Yes"
    121121msgstr "Ja"
    122122
    123 #: admin/acf-city-selector-v4.php:73 admin/acf-city-selector-v5.php:60
     123#: admin/acf-city-selector-v4.php:77 admin/acf-city-selector-v5.php:60
    124124#: admin/acfcs-info.php:170
    125125msgid "No"
    126126msgstr "Nee"
    127127
    128 #: admin/acf-city-selector-v4.php:80 admin/acf-city-selector-v5.php:65
     128#: admin/acf-city-selector-v4.php:84 admin/acf-city-selector-v5.php:65
    129129msgid "Show labels"
    130130msgstr "Toon labels"
    131131
    132 #: admin/acf-city-selector-v4.php:81 admin/acf-city-selector-v5.php:64
     132#: admin/acf-city-selector-v4.php:85 admin/acf-city-selector-v5.php:64
    133133msgid "Show field labels above the dropdown menus"
    134134msgstr "Labels tonen boven de dropdown menu’s"
    135135
    136 #: admin/acf-city-selector-v4.php:97 admin/acf-city-selector-v5.php:96
     136#: admin/acf-city-selector-v4.php:101 admin/acf-city-selector-v5.php:96
    137137msgid "Default country"
    138138msgstr "Default land"
    139139
    140 #: admin/acf-city-selector-v4.php:98 admin/acf-city-selector-v5.php:95
     140#: admin/acf-city-selector-v4.php:102 admin/acf-city-selector-v5.php:95
    141141msgid "Select a default country for a new field"
    142142msgstr "Selecteer een standaard land voor een nieuw veld"
    143143
    144 #: admin/acf-city-selector-v4.php:114 admin/acf-city-selector-v5.php:111
     144#: admin/acf-city-selector-v4.php:118 admin/acf-city-selector-v5.php:111
    145145msgid "Fields to use"
    146146msgstr "Velden om te gebruiken"
    147147
    148 #: admin/acf-city-selector-v4.php:115 admin/acf-city-selector-v5.php:110
     148#: admin/acf-city-selector-v4.php:119 admin/acf-city-selector-v5.php:110
    149149msgid "Select which fields are used"
    150150msgstr "Kies welke velden gebruikt worden"
    151151
    152 #: admin/acf-city-selector-v4.php:178 admin/acf-city-selector-v5.php:160
     152#: admin/acf-city-selector-v4.php:184 admin/acf-city-selector-v5.php:160
    153153msgid ""
    154154"You haven't set a default country, so NO provinces/states and cities will be "
     
    233233
    234234#: admin/acfcs-countries.php:66 admin/acfcs-search.php:172
    235 #: inc/acfcs-functions.php:774 inc/acfcs-help-tabs.php:46
     235#: inc/acfcs-functions.php:749 inc/acfcs-help-tabs.php:46
    236236msgid "Country"
    237237msgstr "Land"
     
    558558
    559559#: admin/acfcs-search.php:68 admin/acfcs-search.php:71
    560 #: inc/acfcs-functions.php:21 inc/acfcs-functions.php:506
    561 #: inc/acfcs-functions.php:928
     560#: inc/acfcs-functions.php:21 inc/acfcs-functions.php:477
     561#: inc/acfcs-functions.php:895
    562562msgid "Select a country"
    563563msgstr "Selecteer een land"
     
    568568
    569569#: admin/acfcs-search.php:89 admin/acfcs-search.php:93
    570 #: inc/acfcs-functions.php:59 inc/acfcs-functions.php:513
    571 #: inc/acfcs-functions.php:930
     570#: inc/acfcs-functions.php:59 inc/acfcs-functions.php:484
     571#: inc/acfcs-functions.php:897
    572572msgid "Select a province/state"
    573573msgstr "Selecteer een provincie/staat"
     
    590590
    591591#: admin/acfcs-search.php:136 admin/acfcs-search.php:170
    592 #: inc/acfcs-functions.php:770 inc/acfcs-help-tabs.php:26
     592#: inc/acfcs-functions.php:745 inc/acfcs-help-tabs.php:26
    593593msgid "City"
    594594msgstr "Stad"
    595595
    596596#: admin/acfcs-search.php:137 admin/acfcs-search.php:171
    597 #: inc/acfcs-functions.php:772 inc/acfcs-help-tabs.php:36
     597#: inc/acfcs-functions.php:747 inc/acfcs-help-tabs.php:36
    598598msgid "State"
    599599msgstr "Staat/provincie"
     
    658658msgstr "Verwijder geselecteerde landen"
    659659
    660 #: admin/acfcs-settings.php:64 admin/acfcs-settings.php:66
    661 msgid "Delete transients"
    662 msgstr "Verwijder transients"
    663 
    664 #: admin/acfcs-settings.php:65
    665 msgid ""
    666 "If you're seeing unexpected results in your dropdowns, try clearing all "
    667 "transients with this option."
    668 msgstr ""
    669 "Als je onverwachte resultaten zien in je dropdowns, probeer dan de "
    670 "transients te verwijderen met deze optie."
    671 
    672 #: admin/acfcs-settings.php:73
     660#: admin/acfcs-settings.php:64
    673661msgid "Clear the database"
    674662msgstr "Maak de database leeg"
    675663
    676 #: admin/acfcs-settings.php:74
     664#: admin/acfcs-settings.php:65
    677665msgid ""
    678666"By selecting this option, you will remove all cities, which are present in "
     
    684672"wilt."
    685673
    686 #: admin/acfcs-settings.php:75
     674#: admin/acfcs-settings.php:66
    687675msgid "Delete everything"
    688676msgstr "Verwijder alles"
    689677
    690 #: admin/acfcs-settings.php:82
     678#: admin/acfcs-settings.php:73
    691679msgid "Delete data"
    692680msgstr "Verwijder data"
    693681
    694 #: admin/acfcs-settings.php:83
     682#: admin/acfcs-settings.php:74
    695683msgid ""
    696684"When the plugin is deleted, all cities are not automatically deleted. Select "
     
    701689"als de plugin wordt verwijderd."
    702690
    703 #: admin/acfcs-settings.php:88 admin/acfcs-settings.php:89
     691#: admin/acfcs-settings.php:79 admin/acfcs-settings.php:80
    704692msgid "Remove cities table on plugin deletion"
    705693msgstr "Verwijder steden bij verwijderen plugin"
    706694
    707 #: admin/acfcs-settings.php:93
     695#: admin/acfcs-settings.php:84
    708696msgid "Save settings"
    709697msgstr "Instellingen opslaan"
     
    794782msgstr ""
    795783
    796 #: inc/acfcs-functions.php:114 inc/acfcs-functions.php:504
    797 #: inc/acfcs-functions.php:927
     784#: inc/acfcs-functions.php:105 inc/acfcs-functions.php:475
     785#: inc/acfcs-functions.php:894
    798786msgid "Select a city"
    799787msgstr "Selecteer een stad"
    800788
    801 #: inc/acfcs-functions.php:300 inc/acfcs-functions.php:305
     789#: inc/acfcs-functions.php:271 inc/acfcs-functions.php:276
    802790msgid "Since your file is not accurate anymore, the file is deleted."
    803791msgstr "Aangezien je bestand fouten bevat, is deze verwijderd."
    804792
    805 #: inc/acfcs-functions.php:301
     793#: inc/acfcs-functions.php:272
    806794#, php-format
    807795msgid "There are too few columns on line %d. %s"
    808796msgstr "Er zijn te weinig kolommen op regel %d. %s"
    809797
    810 #: inc/acfcs-functions.php:309
     798#: inc/acfcs-functions.php:280
    811799#, php-format
    812800msgid "There are too many columns on line %d. %s"
    813801msgstr "Er zijn te veel kolommen op regel %d. %s"
    814802
    815 #: inc/acfcs-functions.php:380
     803#: inc/acfcs-functions.php:351
    816804#, php-format
    817805msgid "There are too few columns on line %d."
    818806msgstr "Er zijn te weinig kolommen op regel %d."
    819807
    820 #: inc/acfcs-functions.php:385
     808#: inc/acfcs-functions.php:356
    821809#, php-format
    822810msgid "There are too many columns on line %d."
    823811msgstr "Er zijn te veel kolommen op regel %d."
    824812
    825 #: inc/acfcs-functions.php:396
     813#: inc/acfcs-functions.php:367
    826814#, php-format
    827815msgid "The length of the country abbreviation on line %d is incorrect."
    828816msgstr "De lengte van de land afkorting op regel %d is incorrect."
    829817
    830 #: inc/acfcs-functions.php:601
     818#: inc/acfcs-functions.php:572
    831819#, php-format
    832820msgid "Congratulations, there appear to be no errors in CSV file: \"%s\"."
    833821msgstr "Gefeliciteerd, er lijken geen fouten te zitten in CSV bestand: \"%s\"."
    834822
    835 #: inc/acfcs-functions.php:642 inc/acfcs-functions.php:644
     823#: inc/acfcs-functions.php:613 inc/acfcs-functions.php:615
    836824#, php-format
    837825msgid "You have successfully imported %d cities from \"%s\"."
    838826msgstr "Gefeliciteerd, je hebt %d steden geïmporteerd uit \"%s\"."
    839827
    840 #: inc/acfcs-functions.php:674
     828#: inc/acfcs-functions.php:645
    841829#, php-format
    842830msgid "Congratulations, you imported 1 city."
     
    845833msgstr[1] "Gefeliciteerd, je hebt %d steden geïmporteerd."
    846834
    847 #: inc/acfcs-functions.php:680 inc/form-handling.php:33
     835#: inc/acfcs-functions.php:651 inc/form-handling.php:33
    848836msgid "You didn't select a file."
    849837msgstr "Je hebt geen bestand gekozen."
    850838
    851 #: inc/acfcs-functions.php:694
     839#: inc/acfcs-functions.php:665
    852840#, php-format
    853841msgid "File \"%s\" successfully deleted."
    854842msgstr "File “%s” is succesvol verwijderd."
    855843
    856 #: inc/acfcs-functions.php:697
     844#: inc/acfcs-functions.php:668
    857845#, php-format
    858846msgid "File \"%s\" is not deleted. Please try again."
    859847msgstr "Het bestand \"%s\" is niet verwijderd. Probeer het aub opnieuw."
    860848
    861 #: inc/acfcs-functions.php:734
     849#: inc/acfcs-functions.php:712
    862850#, php-format
    863851msgid "You have successfully removed all entries for %s."
    864852msgstr "Je hebt alle steden verwijderd voor %s."
    865853
    866 #: inc/acfcs-functions.php:771 inc/acfcs-help-tabs.php:31
     854#: inc/acfcs-functions.php:746 inc/acfcs-help-tabs.php:31
    867855msgid "State code"
    868856msgstr "Staat/provincie code"
    869857
    870 #: inc/acfcs-functions.php:773 inc/acfcs-help-tabs.php:41
     858#: inc/acfcs-functions.php:748 inc/acfcs-help-tabs.php:41
    871859msgid "Country code"
    872860msgstr "Land code"
    873861
    874 #: inc/acfcs-functions.php:926
     862#: inc/acfcs-functions.php:893
    875863msgid "No countries"
    876864msgstr "Geen landen"
    877865
    878 #: inc/acfcs-functions.php:929
     866#: inc/acfcs-functions.php:896
    879867msgid "No results (yet), first select a country"
    880868msgstr "Nog geen resultaten, kies eerst een land"
    881869
    882 #: inc/acfcs-functions.php:931
     870#: inc/acfcs-functions.php:898
    883871msgid "No results (yet), first select a state"
    884872msgstr "Nog geen resultaten, kies eerst een staat/provincie"
     
    11041092#: inc/form-handling.php:8 inc/form-handling.php:30 inc/form-handling.php:64
    11051093#: inc/form-handling.php:88 inc/form-handling.php:109 inc/form-handling.php:143
    1106 #: inc/form-handling.php:159 inc/form-handling.php:178
    1107 #: inc/form-handling.php:198
     1094#: inc/form-handling.php:162 inc/form-handling.php:182
    11081095msgid "Something went wrong, please try again."
    11091096msgstr "Er ging iets fout, probeer het aub nog een keer."
     
    11371124msgstr[1] "Je hebt de volgende steden verwijderd: %s."
    11381125
    1139 #: inc/form-handling.php:146
    1140 msgid "You have successfully deleted all transients."
    1141 msgstr "Je hebt alle transients succesvol verwijderd."
    1142 
    1143 #: inc/form-handling.php:164
     1126#: inc/form-handling.php:148
    11441127msgid "All cities are deleted."
    11451128msgstr "Alle steden zijn verwijderd."
    11461129
    1147 #: inc/form-handling.php:185
     1130#: inc/form-handling.php:169
    11481131msgid "Settings saved"
    11491132msgstr "Instellingen opgeslagen"
     1133
     1134#~ msgid "Delete transients"
     1135#~ msgstr "Verwijder transients"
     1136
     1137#~ msgid ""
     1138#~ "If you're seeing unexpected results in your dropdowns, try clearing all "
     1139#~ "transients with this option."
     1140#~ msgstr ""
     1141#~ "Als je onverwachte resultaten zien in je dropdowns, probeer dan de "
     1142#~ "transients te verwijderen met deze optie."
     1143
     1144#~ msgid "You have successfully deleted all transients."
     1145#~ msgstr "Je hebt alle transients succesvol verwijderd."
    11501146
    11511147#~ msgid "We might ask for this info if support is helping you fix a problem."
     
    11991195#~ msgstr ""
    12001196#~ "Als je meer landen nodig hebt, kan je deze krijgen op de officiële "
    1201 #~ "website: <a href=\"https://acf-city-selector.com/get-countries/\" target="
    1202 #~ "\"_blank\" rel=\"noopener\">acf-city-selector.com</a>."
     1197#~ "website: <a href=\"https://acf-city-selector.com/get-countries/\" "
     1198#~ "target=\"_blank\" rel=\"noopener\">acf-city-selector.com</a>."
    12031199
    12041200#~ msgid "Save data"
     
    12201216#, php-format
    12211217#~ msgid ""
    1222 #~ "<strong>!!!</strong> The default delimiters has been changed from "
    1223 #~ "',' (comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
     1218#~ "<strong>!!!</strong> The default delimiters has been changed from ',' "
     1219#~ "(comma) to ';' (semi-colon). Read more about it <a href=\"%s\">%s</a>."
    12241220#~ msgstr ""
    12251221#~ "<strong>!!!</strong> De default delimiter is gewijzigd van ',' (komma) "
     
    12331229#~ msgstr ""
    12341230#~ "<strong>!!!</strong> In één van de volgende versies (vermoedelijk "
    1235 #~ "0.30.0), wordt de default delimiter gewijzigd van ',' (komma) naar "
    1236 #~ "';' (punt komma). Lees er <a href=\"%s\">%s</a> meer over."
     1231#~ "0.30.0), wordt de default delimiter gewijzigd van ',' (komma) naar ';' "
     1232#~ "(punt komma). Lees er <a href=\"%s\">%s</a> meer over."
    12371233
    12381234#~ msgid "Antwerp"
  • acf-city-selector/trunk/languages/acf-city-selector.pot

    r2841217 r3133754  
    33msgstr ""
    44"Project-Id-Version: ACF City Selector\n"
    5 "POT-Creation-Date: 2022-12-29 19:49+0100\n"
     5"POT-Creation-Date: 2024-07-29 20:44+0200\n"
    66"PO-Revision-Date: 2019-09-14 15:00+0200\n"
    77"Last-Translator: Beee\n"
    88"Language-Team: \n"
     9"Language: en\n"
    910"MIME-Version: 1.0\n"
    1011"Content-Type: text/plain; charset=UTF-8\n"
    1112"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poedit 2.4.3\n"
     13"Plural-Forms: nplurals=2; plural=(n != 1);\n"
     14"X-Generator: Poedit 3.4.4\n"
    1315"X-Poedit-Basepath: ..\n"
    14 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
    15 "Language: en\n"
    1616"X-Poedit-KeywordsList: __;_e;_n;_n:1,2;_n_noop;_nx_noop;esc_html__;esc_html_e;esc_attr;esc_attr__;esc_attr_e;esc_html__;esc_html_e\n"
    1717"X-Poedit-SearchPath-0: .\n"
     
    1919"X-Poedit-SearchPathExcluded-1: assets/js/init.js\n"
    2020
    21 #: ACF_City_Selector.php:169
     21#: ACF_City_Selector.php:167
    2222#, php-format
    2323msgid "Several %s had broken ascii characters. You need to re-import these countries to get the correct city names."
    2424msgstr ""
    2525
    26 #: ACF_City_Selector.php:169
     26#: ACF_City_Selector.php:167
    2727#, php-format
    2828msgid "cities in %s"
    2929msgstr ""
    3030
    31 #: ACF_City_Selector.php:169
     31#: ACF_City_Selector.php:167
    3232msgid "cities in Belgium and Netherlands"
    3333msgstr ""
    3434
    35 #: ACF_City_Selector.php:261 ACF_City_Selector.php:278
    36 #: ACF_City_Selector.php:386
     35#: ACF_City_Selector.php:259 ACF_City_Selector.php:276
     36#: ACF_City_Selector.php:384
    3737msgid "Settings"
    3838msgstr ""
    3939
    40 #: ACF_City_Selector.php:277
     40#: ACF_City_Selector.php:275
    4141msgid "Dashboard"
    4242msgstr ""
    4343
    44 #: ACF_City_Selector.php:281 ACF_City_Selector.php:388
     44#: ACF_City_Selector.php:279 ACF_City_Selector.php:386
    4545#: admin/acfcs-search.php:148
    4646msgid "Search"
    4747msgstr ""
    4848
    49 #: ACF_City_Selector.php:284
     49#: ACF_City_Selector.php:282
    5050msgid "Preview"
    5151msgstr ""
    5252
    53 #: ACF_City_Selector.php:287 ACF_City_Selector.php:389 admin/acfcs-info.php:26
     53#: ACF_City_Selector.php:285 ACF_City_Selector.php:387 admin/acfcs-info.php:26
    5454msgid "Info"
    5555msgstr ""
    5656
    57 #: ACF_City_Selector.php:290
     57#: ACF_City_Selector.php:288
    5858msgid "Get more countries"
    5959msgstr ""
    6060
    61 #: ACF_City_Selector.php:312
     61#: ACF_City_Selector.php:310
    6262#, php-format
    6363msgid "\"%s\" is not activated. This plugin <strong>must</strong> be activated, because without it \"%s\" won't work. Activate it <a href=\"%s\">here</a>."
    6464msgstr ""
    6565
    66 #: ACF_City_Selector.php:334
     66#: ACF_City_Selector.php:332
    6767#, php-format
    6868msgid "%s: The \"%s\" plugin will probably not work properly (anymore) with %s v4.x. Please upgrade to PRO."
    6969msgstr ""
    7070
    71 #: ACF_City_Selector.php:335
     71#: ACF_City_Selector.php:333
    7272msgid "Warning"
    7373msgstr ""
    7474
    75 #: ACF_City_Selector.php:385 admin/acfcs-preview.php:36
     75#: ACF_City_Selector.php:383 admin/acfcs-preview.php:36
    7676msgid "Preview data"
    7777msgstr ""
    7878
    79 #: ACF_City_Selector.php:387 admin/acfcs-countries.php:50
     79#: ACF_City_Selector.php:385 admin/acfcs-countries.php:50
    8080msgid "Get countries"
    8181msgstr ""
    8282
    83 #: admin/acf-city-selector-v4.php:29 admin/acf-city-selector-v5.php:34
     83#: admin/acf-city-selector-v4.php:31 admin/acf-city-selector-v5.php:34
    8484msgid "Choice"
    8585msgstr ""
    8686
    87 #: admin/acf-city-selector-v4.php:64 admin/acf-city-selector-v5.php:102
     87#: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:102
    8888msgid "All fields [default]"
    8989msgstr ""
    9090
    91 #: admin/acf-city-selector-v4.php:65 admin/acf-city-selector-v5.php:103
     91#: admin/acf-city-selector-v4.php:69 admin/acf-city-selector-v5.php:103
    9292msgid "Country only"
    9393msgstr ""
    9494
    95 #: admin/acf-city-selector-v4.php:66 admin/acf-city-selector-v5.php:104
     95#: admin/acf-city-selector-v4.php:70 admin/acf-city-selector-v5.php:104
    9696msgid "Country + State/province"
    9797msgstr ""
    9898
    99 #: admin/acf-city-selector-v4.php:67 admin/acf-city-selector-v5.php:105
     99#: admin/acf-city-selector-v4.php:71 admin/acf-city-selector-v5.php:105
    100100msgid "Country + City"
    101101msgstr ""
    102102
    103 #: admin/acf-city-selector-v4.php:68 admin/acf-city-selector-v5.php:106
     103#: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:106
    104104msgid "State/province + City"
    105105msgstr ""
    106106
    107 #: admin/acf-city-selector-v4.php:72 admin/acf-city-selector-v5.php:59
     107#: admin/acf-city-selector-v4.php:76 admin/acf-city-selector-v5.php:59
    108108#: admin/acfcs-info.php:170
    109109msgid "Yes"
    110110msgstr ""
    111111
    112 #: admin/acf-city-selector-v4.php:73 admin/acf-city-selector-v5.php:60
     112#: admin/acf-city-selector-v4.php:77 admin/acf-city-selector-v5.php:60
    113113#: admin/acfcs-info.php:170
    114114msgid "No"
    115115msgstr ""
    116116
    117 #: admin/acf-city-selector-v4.php:80 admin/acf-city-selector-v5.php:65
     117#: admin/acf-city-selector-v4.php:84 admin/acf-city-selector-v5.php:65
    118118msgid "Show labels"
    119119msgstr ""
    120120
    121 #: admin/acf-city-selector-v4.php:81 admin/acf-city-selector-v5.php:64
     121#: admin/acf-city-selector-v4.php:85 admin/acf-city-selector-v5.php:64
    122122msgid "Show field labels above the dropdown menus"
    123123msgstr ""
    124124
    125 #: admin/acf-city-selector-v4.php:97 admin/acf-city-selector-v5.php:96
     125#: admin/acf-city-selector-v4.php:101 admin/acf-city-selector-v5.php:96
    126126msgid "Default country"
    127127msgstr ""
    128128
    129 #: admin/acf-city-selector-v4.php:98 admin/acf-city-selector-v5.php:95
     129#: admin/acf-city-selector-v4.php:102 admin/acf-city-selector-v5.php:95
    130130msgid "Select a default country for a new field"
    131131msgstr ""
    132132
    133 #: admin/acf-city-selector-v4.php:114 admin/acf-city-selector-v5.php:111
     133#: admin/acf-city-selector-v4.php:118 admin/acf-city-selector-v5.php:111
    134134msgid "Fields to use"
    135135msgstr ""
    136136
    137 #: admin/acf-city-selector-v4.php:115 admin/acf-city-selector-v5.php:110
     137#: admin/acf-city-selector-v4.php:119 admin/acf-city-selector-v5.php:110
    138138msgid "Select which fields are used"
    139139msgstr ""
    140140
    141 #: admin/acf-city-selector-v4.php:178 admin/acf-city-selector-v5.php:160
     141#: admin/acf-city-selector-v4.php:184 admin/acf-city-selector-v5.php:160
    142142msgid "You haven't set a default country, so NO provinces/states and cities will be loaded."
    143143msgstr ""
     
    210210
    211211#: admin/acfcs-countries.php:66 admin/acfcs-search.php:172
    212 #: inc/acfcs-functions.php:774 inc/acfcs-help-tabs.php:46
     212#: inc/acfcs-functions.php:749 inc/acfcs-help-tabs.php:46
    213213msgid "Country"
    214214msgstr ""
     
    503503
    504504#: admin/acfcs-search.php:68 admin/acfcs-search.php:71
    505 #: inc/acfcs-functions.php:21 inc/acfcs-functions.php:506
    506 #: inc/acfcs-functions.php:928
     505#: inc/acfcs-functions.php:21 inc/acfcs-functions.php:477
     506#: inc/acfcs-functions.php:895
    507507msgid "Select a country"
    508508msgstr ""
     
    513513
    514514#: admin/acfcs-search.php:89 admin/acfcs-search.php:93
    515 #: inc/acfcs-functions.php:59 inc/acfcs-functions.php:513
    516 #: inc/acfcs-functions.php:930
     515#: inc/acfcs-functions.php:59 inc/acfcs-functions.php:484
     516#: inc/acfcs-functions.php:897
    517517msgid "Select a province/state"
    518518msgstr ""
     
    535535
    536536#: admin/acfcs-search.php:136 admin/acfcs-search.php:170
    537 #: inc/acfcs-functions.php:770 inc/acfcs-help-tabs.php:26
     537#: inc/acfcs-functions.php:745 inc/acfcs-help-tabs.php:26
    538538msgid "City"
    539539msgstr ""
    540540
    541541#: admin/acfcs-search.php:137 admin/acfcs-search.php:171
    542 #: inc/acfcs-functions.php:772 inc/acfcs-help-tabs.php:36
     542#: inc/acfcs-functions.php:747 inc/acfcs-help-tabs.php:36
    543543msgid "State"
    544544msgstr ""
     
    598598msgstr ""
    599599
    600 #: admin/acfcs-settings.php:64 admin/acfcs-settings.php:66
    601 msgid "Delete transients"
     600#: admin/acfcs-settings.php:64
     601msgid "Clear the database"
    602602msgstr ""
    603603
    604604#: admin/acfcs-settings.php:65
    605 msgid "If you're seeing unexpected results in your dropdowns, try clearing all transients with this option."
     605msgid "By selecting this option, you will remove all cities, which are present in the database. This is useful if you don't need the preset cities or you want a fresh start."
     606msgstr ""
     607
     608#: admin/acfcs-settings.php:66
     609msgid "Delete everything"
    606610msgstr ""
    607611
    608612#: admin/acfcs-settings.php:73
    609 msgid "Clear the database"
     613msgid "Delete data"
    610614msgstr ""
    611615
    612616#: admin/acfcs-settings.php:74
    613 msgid "By selecting this option, you will remove all cities, which are present in the database. This is useful if you don't need the preset cities or you want a fresh start."
    614 msgstr ""
    615 
    616 #: admin/acfcs-settings.php:75
    617 msgid "Delete everything"
    618 msgstr ""
    619 
    620 #: admin/acfcs-settings.php:82
    621 msgid "Delete data"
    622 msgstr ""
    623 
    624 #: admin/acfcs-settings.php:83
    625617msgid "When the plugin is deleted, all cities are not automatically deleted. Select this option to delete the cities table as well upon deletion."
    626618msgstr ""
    627619
    628 #: admin/acfcs-settings.php:88 admin/acfcs-settings.php:89
     620#: admin/acfcs-settings.php:79 admin/acfcs-settings.php:80
    629621msgid "Remove cities table on plugin deletion"
    630622msgstr ""
    631623
    632 #: admin/acfcs-settings.php:93
     624#: admin/acfcs-settings.php:84
    633625msgid "Save settings"
    634626msgstr ""
     
    705697msgstr ""
    706698
    707 #: inc/acfcs-functions.php:114 inc/acfcs-functions.php:504
    708 #: inc/acfcs-functions.php:927
     699#: inc/acfcs-functions.php:105 inc/acfcs-functions.php:475
     700#: inc/acfcs-functions.php:894
    709701msgid "Select a city"
    710702msgstr ""
    711703
    712 #: inc/acfcs-functions.php:300 inc/acfcs-functions.php:305
     704#: inc/acfcs-functions.php:271 inc/acfcs-functions.php:276
    713705msgid "Since your file is not accurate anymore, the file is deleted."
    714706msgstr ""
    715707
    716 #: inc/acfcs-functions.php:301
     708#: inc/acfcs-functions.php:272
    717709#, php-format
    718710msgid "There are too few columns on line %d. %s"
    719711msgstr ""
    720712
    721 #: inc/acfcs-functions.php:309
     713#: inc/acfcs-functions.php:280
    722714#, php-format
    723715msgid "There are too many columns on line %d. %s"
    724716msgstr ""
    725717
    726 #: inc/acfcs-functions.php:380
     718#: inc/acfcs-functions.php:351
    727719#, php-format
    728720msgid "There are too few columns on line %d."
    729721msgstr ""
    730722
    731 #: inc/acfcs-functions.php:385
     723#: inc/acfcs-functions.php:356
    732724#, php-format
    733725msgid "There are too many columns on line %d."
    734726msgstr ""
    735727
    736 #: inc/acfcs-functions.php:396
     728#: inc/acfcs-functions.php:367
    737729#, php-format
    738730msgid "The length of the country abbreviation on line %d is incorrect."
    739731msgstr ""
    740732
    741 #: inc/acfcs-functions.php:601
     733#: inc/acfcs-functions.php:572
    742734#, php-format
    743735msgid "Congratulations, there appear to be no errors in CSV file: \"%s\"."
    744736msgstr ""
    745737
    746 #: inc/acfcs-functions.php:642 inc/acfcs-functions.php:644
     738#: inc/acfcs-functions.php:613 inc/acfcs-functions.php:615
    747739#, php-format
    748740msgid "You have successfully imported %d cities from \"%s\"."
    749741msgstr ""
    750742
    751 #: inc/acfcs-functions.php:674
     743#: inc/acfcs-functions.php:645
    752744#, php-format
    753745msgid "Congratulations, you imported 1 city."
     
    756748msgstr[1] ""
    757749
    758 #: inc/acfcs-functions.php:680 inc/form-handling.php:33
     750#: inc/acfcs-functions.php:651 inc/form-handling.php:33
    759751msgid "You didn't select a file."
    760752msgstr ""
    761753
    762 #: inc/acfcs-functions.php:694
     754#: inc/acfcs-functions.php:665
    763755#, php-format
    764756msgid "File \"%s\" successfully deleted."
    765757msgstr ""
    766758
    767 #: inc/acfcs-functions.php:697
     759#: inc/acfcs-functions.php:668
    768760#, php-format
    769761msgid "File \"%s\" is not deleted. Please try again."
    770762msgstr ""
    771763
    772 #: inc/acfcs-functions.php:734
     764#: inc/acfcs-functions.php:712
    773765#, php-format
    774766msgid "You have successfully removed all entries for %s."
    775767msgstr ""
    776768
    777 #: inc/acfcs-functions.php:771 inc/acfcs-help-tabs.php:31
     769#: inc/acfcs-functions.php:746 inc/acfcs-help-tabs.php:31
    778770msgid "State code"
    779771msgstr ""
    780772
    781 #: inc/acfcs-functions.php:773 inc/acfcs-help-tabs.php:41
     773#: inc/acfcs-functions.php:748 inc/acfcs-help-tabs.php:41
    782774msgid "Country code"
    783775msgstr ""
    784776
    785 #: inc/acfcs-functions.php:926
     777#: inc/acfcs-functions.php:893
    786778msgid "No countries"
    787779msgstr ""
    788780
    789 #: inc/acfcs-functions.php:929
     781#: inc/acfcs-functions.php:896
    790782msgid "No results (yet), first select a country"
    791783msgstr ""
    792784
    793 #: inc/acfcs-functions.php:931
     785#: inc/acfcs-functions.php:898
    794786msgid "No results (yet), first select a state"
    795787msgstr ""
     
    990982#: inc/form-handling.php:8 inc/form-handling.php:30 inc/form-handling.php:64
    991983#: inc/form-handling.php:88 inc/form-handling.php:109 inc/form-handling.php:143
    992 #: inc/form-handling.php:159 inc/form-handling.php:178
    993 #: inc/form-handling.php:198
     984#: inc/form-handling.php:162 inc/form-handling.php:182
    994985msgid "Something went wrong, please try again."
    995986msgstr ""
     
    10191010msgstr[1] ""
    10201011
    1021 #: inc/form-handling.php:146
    1022 msgid "You have successfully deleted all transients."
    1023 msgstr ""
    1024 
    1025 #: inc/form-handling.php:164
     1012#: inc/form-handling.php:148
    10261013msgid "All cities are deleted."
    10271014msgstr ""
    10281015
    1029 #: inc/form-handling.php:185
     1016#: inc/form-handling.php:169
    10301017msgid "Settings saved"
    10311018msgstr ""
  • acf-city-selector/trunk/readme.txt

    r3074624 r3133754  
    44Requires at least: 3.6.0
    55Requires PHP: 7.0
    6 Tested up to: 6.5.2
    7 Stable tag: 1.13.0
     6Tested up to: 6.6.1
     7Stable tag: 1.14.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4242== Changelog ==
    4343
     44= 1.14.0 =
     45* update database queries for searching citites in admin
     46* update database queries for deleting countries in admin
     47* removed transients because it conflicted with translation
     48
    4449= 1.13.0 =
    4550* Fix typo in function call
Note: See TracChangeset for help on using the changeset viewer.