Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1.12.0 #128

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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