Changeset 548888
- Timestamp:
- 05/25/2012 09:03:14 AM (13 years ago)
- Location:
- cat-tag-filter-widget
- Files:
-
- 11 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cat-tag-filter-widget/trunk/cat-tag-filter.php
r536741 r548888 5 5 Description: This plugin adds a widget to your WordPress site that allows your visitors to filter posts by category and tag. 6 6 Author: Ajay Verma 7 Version: 0. 67 Version: 0.7 8 8 Author URI: http://ajayver.com/ 9 9 */ … … 87 87 global $ctf_options, $current_tax; 88 88 89 if ($ctf_options['exclude_tags'] != '') $args = 'exclude=' .$ctf_options['exclude_tags'];89 if ($ctf_options['exclude_tags'] != '') $args['exclude'] = $ctf_options['exclude_tags']; 90 90 else $args = ''; 91 if($current_tax[cats][0]){ 92 93 $cat_args = array( 94 'cat' => $current_tax[cats][0] 95 ); 96 query_posts($cat_args); 97 if(have_posts()): while (have_posts()) : the_post(); 98 $all_tag_objects = get_the_terms($post->ID, $ctf_options['tag_tax']); 99 if($all_tag_objects){ 100 $ctf_options['exclude_tags'] = str_replace(" ", "", $ctf_options['exclude_tags']); 101 $exclude = explode(',', $ctf_options['exclude_tags']); 102 foreach($all_tag_objects as $tag) { 103 if($tag->count > 0) { 104 if (!in_array($tag->term_id, $exclude)) $all_tag_ids[] = $tag->term_id; 105 } 106 } 107 } 108 endwhile; 109 endif; 110 $tags = array_unique($all_tag_ids); 111 if (!empty($tags)){ 112 foreach ($tags as $tag){ 113 $include .= $tag . ','; 114 } 115 $include = substr($include, 0, -1); 116 $args['include'] = $include; 117 118 } 119 120 } 91 121 $tags = get_terms($ctf_options['tag_tax'],$args); 122 123 92 124 if ($type == 1){ 93 125 $options .= '<ul>';
Note: See TracChangeset
for help on using the changeset viewer.