From 0ed0c4bde4b513681ad48cde2290b48ea8dd4a47 Mon Sep 17 00:00:00 2001 From: Beee Date: Fri, 8 Mar 2024 23:10:08 +0100 Subject: [PATCH 1/2] Fix transient --- inc/acfcs-actions.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/inc/acfcs-actions.php b/inc/acfcs-actions.php index 4f9f232..36ed5d9 100755 --- a/inc/acfcs-actions.php +++ b/inc/acfcs-actions.php @@ -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' ); From 7fde83fb3ba398a87b86bb98009e52a29fbbc5d5 Mon Sep 17 00:00:00 2001 From: Beee Date: Fri, 8 Mar 2024 23:10:16 +0100 Subject: [PATCH 2/2] Update version + changelog --- ACF_City_Selector.php | 6 +++--- README.md | 2 +- readme.txt | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ACF_City_Selector.php b/ACF_City_Selector.php index 49053c3..3d0bcac 100755 --- a/ACF_City_Selector.php +++ b/ACF_City_Selector.php @@ -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 @@ -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' ) ) { diff --git a/README.md b/README.md index bea9100..1d36d62 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Welcome to the City Selector plugin, which is an extension for [Advanced Custom ### Version -1.11.0 - released 01.05.23 +1.12.0 - released 09.03.24 ### Description diff --git a/readme.txt b/readme.txt index d81b49f..32d0e7a 100755 --- a/readme.txt +++ b/readme.txt @@ -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 @@ -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