From 2c02c098bd7085635c340e6b901797d936939c90 Mon Sep 17 00:00:00 2001 From: Mandi Wise Date: Thu, 20 Nov 2014 09:49:48 -0800 Subject: [PATCH] Prevent filter menu from showing excluded terms. --- README.md | 7 +++---- isotope-posts.php | 2 +- public/class-isotope-posts.php | 9 ++++----- readme.txt | 9 ++++----- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7db8de8..69d7667 100755 --- a/README.md +++ b/README.md @@ -23,10 +23,6 @@ Some features: If you're upgrading to v2+ of Isotope Posts from v1.X, you'll need to run the [Isotope Posts v2 Migrator plugin](https://github.com/mandiwise/isotope-posts-migrator) first. Be sure to deactivate and delete the migrator plugin before attempting to re-activate of Isotope Posts. -*A word of caution...* - -This is a soft-launch of v2 of the Isotope Posts plugin. There may still be a few kinks to work out, so please report all bugs in the [Issues](https://github.com/mandiwise/isotope-posts/issues) section of the repo. - ### A note re: licensing Metafizzy's javascript Isotope plugin is licensed under MIT and free to use for non-commercial, personal, open-source projects only. Find out more about [commercial licensing](http://isotope.metafizzy.co/license.html) if you plan on using this plugin for commercial purposes. @@ -91,6 +87,9 @@ Yes, but no translations are available quite yet. ## Changelog +### 2.0.8 +* Fix filter menu so that it doesn't show excluded terms when the filter menu taxonomy is the same as the limiting taxonomy (again) + ### 2.0.7 * Adjust pre-filling behaviour when using filtering and infinite scrolling together (even though this is not advisable) to address JS errors * Remove old Isotope js file diff --git a/isotope-posts.php b/isotope-posts.php index a1485f7..d1d162d 100755 --- a/isotope-posts.php +++ b/isotope-posts.php @@ -12,7 +12,7 @@ * Plugin Name: Isotope Posts * Plugin URI: http://mandiwise.com/wordpress/isotope-posts/ * Description: Allows you to use Metafizzy's Isotope to display feeds of WordPress posts using simple shortcodes. Works with custom post types and custom taxonomies too. - * Version: 2.0.7 + * Version: 2.0.8 * Author: Mandi Wise * Author URI: http://mandiwise.com * Text Domain: isotope-posts diff --git a/public/class-isotope-posts.php b/public/class-isotope-posts.php index f964384..ddae09b 100755 --- a/public/class-isotope-posts.php +++ b/public/class-isotope-posts.php @@ -18,7 +18,7 @@ class Isotope_Posts { * * @var string */ - const VERSION = '2.0.7'; + const VERSION = '2.0.8'; /** * Unique identifier for the plugin. @@ -338,15 +338,14 @@ public function isotope_loop( $atts ) { // If the menu taxonomy is the same as the limiting taxonomy, the convert the limited term slugs into IDs. if ( $filter_by == $limit_by ) { - global $wpdb; $limited_terms = explode( ',', $limit_term ); $excluded_ids = array(); - foreach( $limited_terms as $limitedterm ) { - $term_id = $wpdb->get_var( "SELECT term_id FROM $wpdb->terms WHERE slug='$limitedterm'" ); + foreach( $limited_terms as $term ) { + $term_id = get_term_by( 'slug', $term, $limit_by )->term_id; $excluded_ids[] = $term_id; } - $id_string = implode( ' ', $excluded_ids ); + $id_string = implode( ',', $excluded_ids ); } else { $id_string = ''; diff --git a/readme.txt b/readme.txt index ce8794f..539f97a 100755 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: mandiwise Tags: isotope, javascript, posts Requires at least: 3.5.1 Tested up to: 4.0 -Stable tag: 2.0.7 +Stable tag: 2.0.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -32,10 +32,6 @@ Some features: If you're upgrading to v2+ of Isotope Posts from v1.X, you'll need to run the [Isotope Posts v2 Migrator plugin](https://github.com/mandiwise/isotope-posts-migrator) first. Be sure to deactivate and delete the migrator plugin before attempting to re-activate of Isotope Posts. -*A word of caution...* - -This is a soft-launch of v2 of the Isotope Posts plugin. There may still be a few kinks to work out, so please report all bugs in the [Issues](https://github.com/mandiwise/isotope-posts/issues) section of the repo. - = A note re: licensing: = Metafizzy's javascript Isotope plugin is licensed under MIT and free to use for non-commercial, personal, open-source projects only. Find out more about [commercial licensing](http://isotope.metafizzy.co/license.html) if you plan on using this plugin for commercial purposes. @@ -98,6 +94,9 @@ Yes, but no translations are available quite yet. == Changelog == += 2.0.8 = +* Fix filter menu so that it doesn't show excluded terms when the filter menu taxonomy is the same as the limiting taxonomy (again) + = 2.0.7 = * Adjust pre-filling behaviour when using filtering and infinite scrolling together (even though this is not advisable) to address JS errors * Remove old Isotope js file