Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
[fix] filter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alekart committed Oct 13, 2015
1 parent 6142436 commit 2646487
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 13 additions & 1 deletion arcw-popover.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 2646487

Please sign in to comment.