Skip to content

Commit

Permalink
Merge pull request #128 from Beee4life/feature/1.12.0
Browse files Browse the repository at this point in the history
Feature/1.12.0
  • Loading branch information
Beee4life authored Mar 9, 2024
2 parents 54903be + 7fde83f commit faa3f72
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
6 changes: 3 additions & 3 deletions ACF_City_Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Plugin Name: ACF City Selector
Plugin URI: https://acf-city-selector.com
Description: An extension for ACF which allows you to select a city based on country and province/state.
Version: 1.11.0
Tested up to: 6.1.1
Version: 1.12.0
Tested up to: 6.4.3
Requires PHP: 7.0
Author: Beee
Author URI: https://berryplasman.com
Expand Down Expand Up @@ -35,7 +35,7 @@ public function __construct() {
$this->settings = array(
'db_version' => '1.0',
'url' => plugin_dir_url( __FILE__ ),
'version' => '1.11.0',
'version' => '1.12.0',
);

if ( ! class_exists( 'ACFCS_WEBSITE_URL' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Welcome to the City Selector plugin, which is an extension for [Advanced Custom
<a name="version"></a>
### Version

1.11.0 - released 01.05.23
1.12.0 - released 09.03.24

<a name="description"></a>
### Description
Expand Down
14 changes: 11 additions & 3 deletions inc/acfcs-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@
function acfcs_delete_transients( $country_code = false ) {
if ( false != $country_code ) {
delete_transient( 'acfcs_states_' . strtolower( $country_code ) );
delete_transient( 'acfcs_cities_' . strtolower( $country_code ) );

// get states for country code
$states = acfcs_get_states( $country_code );
foreach( $states as $key => $state ) {
$country_code_with_state = strtolower( $key );
delete_transient( 'acfcs_cities_' . $country_code_with_state );
}

} else {
delete_transient( 'acfcs_countries' );
$countries = acfcs_get_countries( false, false, true );

if ( ! empty( $countries ) ) {
foreach( $countries as $country_code => $label ) {
do_action( 'acfcs_delete_transients', $country_code );
// @TODO: also add states
delete_transient( sprintf( 'acfcs_states_%s', $country_code ) );
}
}
}
}
add_action( 'acfcs_delete_transients', 'acfcs_delete_transients' );
add_action( 'acfcs_delete_transients', 'i will try acfcs_delete_transients' );
add_action( 'acfcs_after_success_import', 'acfcs_delete_transients' );
add_action( 'acfcs_after_success_import_raw', 'acfcs_delete_transients' );
add_action( 'acfcs_after_success_nuke', 'acfcs_delete_transients' );
Expand Down
10 changes: 8 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Tags: acf, custom, fields, custom fields, select, country, city, state, province
Contributors: beee
Requires at least: 3.6.0
Requires PHP: 7.0
Tested up to: 6.1.1
Stable tag: 1.10.1
Tested up to: 6.4.3
Stable tag: 1.12.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -41,6 +41,12 @@ A. Please read the FAQ @ [https://acf-city-selector.com/documentation/](https://

== Changelog ==

= 1.12.0 =
* Fix clear transients

= 1.11.0 =
* ?

= 1.10.1 =
* New language files

Expand Down

0 comments on commit faa3f72

Please sign in to comment.