Skip to content

Commit

Permalink
Prevent filter menu from showing excluded terms.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandiwise committed Nov 20, 2014
1 parent 25011a0 commit 2c02c09
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion isotope-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions public/class-isotope-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Isotope_Posts {
*
* @var string
*/
const VERSION = '2.0.7';
const VERSION = '2.0.8';

/**
* Unique identifier for the plugin.
Expand Down Expand Up @@ -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 = '';
Expand Down
9 changes: 4 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2c02c09

Please sign in to comment.