Plugin Directory

Changeset 606245


Ignore:
Timestamp:
09/30/2012 06:45:38 PM (12 years ago)
Author:
ajayver
Message:
 
Location:
cat-tag-filter-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cat-tag-filter-widget/trunk/cat-tag-filter.php

    r606089 r606245  
    55Description: This plugin adds a widget to your WordPress site that allows your visitors to filter posts by category and tag.
    66Author: Ajay Verma
    7 Version: 0.8.1
     7Version: 0.8.2
    88Author URI: http://ajayver.com/
    99*/
     
    9090  global $ctf_options, $current_tax;
    9191 
    92   if($current_tax[cats][0]){
    93 
    94     $cat_args = array(
    95         'cat'      => $current_tax[cats][0]
    96     );
    97     query_posts($cat_args);
    98     if(have_posts()): while (have_posts()) : the_post();
    99         $all_tag_objects = get_the_terms($post->ID, $ctf_options['tag_tax']);
    100         if($all_tag_objects){   
    101             foreach($all_tag_objects as $tag) {
    102                 if($tag->count > 0) $all_tag_ids[] = $tag->term_id;
    103             }
    104         }
    105     endwhile;
    106     endif;
    107     $tags = array_unique($all_tag_ids);
    108     if (!empty($tags)){
     92    if($current_tax[cats][0]){
     93
     94        $cat_args = array(
     95            'cat'      => $current_tax[cats][0]
     96        );
     97        query_posts($cat_args);
     98        if(have_posts()): while (have_posts()) : the_post();
     99            $all_tag_objects = get_the_terms($post->ID, $ctf_options['tag_tax']);
     100            if($all_tag_objects){   
     101                foreach($all_tag_objects as $tag) {
     102                    if($tag->count > 0) $all_tag_ids[] = $tag->term_id;
     103                }
     104            }
     105        endwhile;
     106        endif;
     107        $tags = array_unique($all_tag_ids);
     108       
    109109        if ($ctf_options['exclude_tags'] != ''){
    110110            $ctf_options['exclude_tags'] = str_replace(" ", "", $ctf_options['exclude_tags']);
    111111            $exclude = explode(',', $ctf_options['exclude_tags']);
    112         }
     112       
    113113       
    114114        if ($ctf_options['clude_tags'] == 'include') {
     
    123123        }
    124124       
     125        }
    125126        $include = substr($include, 0, -1);
    126127        $args['include'] = $include;
    127128   
    128129    }
    129    
    130 }
     130    else {
     131       
     132        $args[$ctf_options['clude_tags']] = $ctf_options['exclude_tags'];
     133       
     134    }
     135
     136
     137       
     138       
     139       
    131140  $tags = get_terms($ctf_options['tag_tax'],$args);
    132141
  • cat-tag-filter-widget/trunk/readme.txt

    r606088 r606245  
    55Requires at least: 2.8
    66Tested up to: 3.4.2
    7 Stable tag: 0.8.1
     7Stable tag: 0.8.2
    88
    99This plugin adds a widget to your WordPress site that gives your visitors an ability to filter all your posts by a category or/and tag.
     
    7474== Changelog ==
    7575
    76 = 0.8.1 =
     76= 0.8.2 =
    7777* fixed a bug with tags including\excluding.
    7878
Note: See TracChangeset for help on using the changeset viewer.