Skip to content

Commit

Permalink
Merge pull request #47 from the-events-calendar/release/4.5.3
Browse files Browse the repository at this point in the history
Properly decode the saved filter when loading the post list page
  • Loading branch information
borkweb authored Aug 5, 2022
2 parents 2425e34 + 93811ac commit 4ff9317
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
9 changes: 6 additions & 3 deletions lib/tribe-filters.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,11 @@ public function init_active() {
$this->set_active( $active );
$this->saved_active = $filterset;
}
} elseif ( ! $_POST && $last_query = $this->last_query() ) {
$this->set_active( $last_query );
} elseif ( ! $_POST ) {
$last_query = $this->last_query();
if ( $last_query ) {
$this->set_active( $last_query );
}
}
}

Expand Down Expand Up @@ -454,7 +457,7 @@ public function enqueue() {
// UTLITIES AND INTERNAL METHODS

protected function last_query() {
return get_user_meta( get_current_user_id(), 'last_used_filters_' . $this->filtered_post_type, true );
return json_decode( get_user_meta( get_current_user_id(), 'last_used_filters_' . $this->filtered_post_type, true ), true );
}

protected function cache_last_query( $query ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "advanced-post-manager",
"version": "4.5.2",
"version": "4.5.3",
"repository": "[email protected]:the-events-calendar/advanced-post-manager.git",
"_zipname": "advanced-post-manager",
"_zipfoldername": "advanced-post-manager",
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Contributors: aguseo, bordoni, borkweb, brianjessee, GeoffBel, leahkoerper, lucatume, neillmcshea, vicskf, zbtirrell, juanfra
Donate link: https://evnt.is/4o
Tags: developer-tools, custom post, filter, column, metabox, taxonomy, wp-admin, admin, Post, post type, plugin, advanced, tribe
Requires at least: 5.6
Requires at least: 5.7
Tested up to: 6.0.1
License: GPL v2
Stable tag: 4.5.2
Stable tag: 4.5.3
Requires PHP: 7.1

Turbo charge your posts admin for any custom post type with sortable filters and columns, and auto-registration of metaboxes.
Expand Down Expand Up @@ -67,6 +67,10 @@ Our Premium Plugins and Services:

== Changelog ==

= [4.5.3] 2022-08-05 =

* Fix - Resolve issue where filters that were being set were being lost after editing posts.

= [4.5.2] 2022-07-14 =

* Security - Store filter data using JSON rather than serialized strings for safer and smaller strings.
Expand Down
4 changes: 2 additions & 2 deletions tribe-apm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
Plugin Name: Advanced Post Manager
Description: Dialing custom post types to 11 with advanced filtering controls.
Version: 4.5.2
Version: 4.5.3
Author: Modern Tribe, Inc.
Author URI: https://evnt.is/4n
Text Domain: advanced-post-manager
Expand Down Expand Up @@ -45,7 +45,7 @@ class Tribe_APM {
/**
* The current version of iCal Importer
*/
const VERSION = '4.5.2';
const VERSION = '4.5.3';

protected $textdomain = 'advanced-post-manager';
protected $args;
Expand Down

0 comments on commit 4ff9317

Please sign in to comment.