diff --git a/arcw-popover.php b/arcw-popover.php index c73d429..ab683d0 100644 --- a/arcw-popover.php +++ b/arcw-popover.php @@ -81,7 +81,7 @@ function arcwp_get_archives_list() { $args = array( 'posts_per_page' => 0, - 'cat' => $post_type == 'post' ? $cat : '', + 'cat' => $cat, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => $post_type, @@ -96,6 +96,18 @@ function arcwp_get_archives_list() { ) ); + if(!empty($cat)) { + $args['tax_query'] = array( + 'relation' => 'AND', + array( + 'taxonomy' => 'category', + 'field' => 'term_id', + 'terms' => explode(',', $cat), + 'operator' => 'IN', + ), + ); + } + $posts_array = get_posts( $args ); $max = 5; diff --git a/readme.txt b/readme.txt index 2390727..e8ca422 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: alekart Tags: archives, calendar, widget, sidebar, view, plugin, addon, extension Requires at least: 3.6 Tested up to: 4.3.1 -Stable tag: 0.1.1 +Stable tag: 0.1.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -25,6 +25,9 @@ Please use the Support section to report issues. == Changelog == += 0.1.2 = +* [fix] filter fix + = 0.1.1 = * [fix] for ajax requests, now works for users and visitors