Plugin Directory

Changeset 609235


Ignore:
Timestamp:
10/07/2012 05:36:30 PM (12 years ago)
Author:
ajayver
Message:
 
Location:
cat-tag-filter-widget
Files:
8 edited

Legend:

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

    r607352 r609235  
    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.4
     7Version: 0.8.5
    88Author URI: http://ajayver.com/
    99*/
     
    9191    $there_are_tags = true;
    9292    $args = '';
    93     if($current_tax['cats'][0]){
     93    if($current_tax['cats'][0] && $ctf_options['corresponding_tags'] == 1){
    9494
    9595        $cat_args = array(
    96             'cat'      => $current_tax[cats][0]
     96            'cat'      => $current_tax[cats][0],
     97            'posts_per_page' => -1
    9798        );
    9899        query_posts($cat_args);
     
    102103                foreach($all_tag_objects as $tag) {
    103104                    if($tag->count > 0) $all_tag_ids[] = $tag->term_id;
     105                    echo '<!--' . $tag->term_id . '-->';
    104106                }
    105107            }
     
    125127                }
    126128            }
     129           
     130            if ($include == '') $there_are_tags = false;
    127131       
    128132        }
     
    134138        $include = substr($include, 0, -1);
    135139       
     140       
    136141        $args['include'] = $include;
    137142        }
     
    149154
    150155       
    151        
    152        
     156    echo "<!--";   
     157    echo "\n";
     158    echo  $ctf_options['clude_tags'] . ' tags: ' . $ctf_options['exclude_tags'] . "\n";
     159    echo  $ctf_options['clude_cats'] . ' cats: ' . $ctf_options['exclude_cats'] . "\n";
     160    echo "current category: " . $current_tax['cats'][0] . "\n";
     161    echo 'corresponding tags for this category: ';
     162    print_r($all_tag_ids);
     163    echo "\n";
     164    echo 'Final tags to include: ';
     165    print_r($args);
     166    echo "-->";
    153167  if ($there_are_tags) $tags = get_terms($ctf_options['tag_tax'],$args);
    154168
     
    234248  /** @see WP_Widget::widget */
    235249  function widget($args, $instance) {   
    236       $defaults = array( 'title' => __('Filter', 'cat-tag-filter'), 'button_title' => __('Show posts', 'cat-tag-filter'), 'cat_list_hide' => false,  'cat_list_label' => __('Show posts from:', 'cat-tag-filter'), 'tag_list_label' => __('With tag:', 'cat-tag-filter'), 'all_cats_text' => __('Any category', 'cat-tag-filter'), 'all_tags_text' => __('Any tag', 'cat-tag-filter'), 'cats_count' => 1, 'tags_count' => 0, 'tag_logic' => 1, 'tag_type' => 0, 'exclude_tags' => '', 'exclude_cats' => '', 'clude_tags' => 'exclude', 'clude_cats' => 'exclude', 'tag_tax' => 'post_tag', 'category_tax' => 'category');
     250      $defaults = array( 'title' => __('Filter', 'cat-tag-filter'), 'button_title' => __('Show posts', 'cat-tag-filter'), 'cat_list_hide' => false,  'cat_list_label' => __('Show posts from:', 'cat-tag-filter'), 'tag_list_label' => __('With tag:', 'cat-tag-filter'), 'all_cats_text' => __('Any category', 'cat-tag-filter'), 'all_tags_text' => __('Any tag', 'cat-tag-filter'), 'corresponding_tags' => '1', 'cats_count' => 1, 'tags_count' => 0, 'tag_logic' => 1, 'tag_type' => 0, 'exclude_tags' => '', 'exclude_cats' => '', 'clude_tags' => 'exclude', 'clude_cats' => 'exclude', 'tag_tax' => 'post_tag', 'category_tax' => 'category');
    237251    $instance = wp_parse_args( (array) $instance, $defaults );
    238252    extract( $args );
     
    246260    $ctf_options['all_tags_text'] = apply_filters('widget_title', $instance['all_tags_text']);
    247261    $ctf_options['cats_count'] =  $instance['cats_count'];
     262    $ctf_options['corresponding_tags'] =  $instance['corresponding_tags'];
    248263    $ctf_options['tags_count'] =  $instance['tags_count'];
    249264    $ctf_options['tag_logic'] =  $instance['tag_logic'];
     
    271286    $instance['all_tags_text'] = strip_tags($new_instance['all_tags_text']);
    272287    $instance['cats_count'] = $new_instance['cats_count'];
     288    $instance['corresponding_tags'] = $new_instance['corresponding_tags'];
    273289    $instance['tags_count'] = $new_instance['tags_count'];
    274290    $instance['tag_logic'] = $new_instance['tag_logic'];
     
    284300  /** @see WP_Widget::form */
    285301  function form($instance) {   
    286     $defaults = array( 'title' => __('Filter', 'cat-tag-filter'), 'button_title' => __('Show posts', 'cat-tag-filter'), 'cat_list_hide' => false, 'cat_list_label' => __('Show posts from:', 'cat-tag-filter'), 'tag_list_label' => __('With tag:', 'cat-tag-filter'), 'all_cats_text' => __('Any category', 'cat-tag-filter'), 'all_tags_text' => __('Any tag', 'cat-tag-filter'), 'cats_count' => 1, 'tags_count' => 0, 'tag_logic' => 1, 'tag_type' => 0, 'exclude_tags' => '', 'exclude_cats' => '', 'clude_tags' => 'exclude', 'clude_cats' => 'exclude', 'tag_tax' => 'post_tag', 'category_tax' => 'category' );
     302    $defaults = array( 'title' => __('Filter', 'cat-tag-filter'), 'button_title' => __('Show posts', 'cat-tag-filter'), 'cat_list_hide' => false, 'cat_list_label' => __('Show posts from:', 'cat-tag-filter'), 'tag_list_label' => __('With tag:', 'cat-tag-filter'), 'all_cats_text' => __('Any category', 'cat-tag-filter'), 'all_tags_text' => __('Any tag', 'cat-tag-filter'), 'corresponding_tags' => '1', 'cats_count' => 1, 'tags_count' => 0, 'tag_logic' => 1, 'tag_type' => 0, 'exclude_tags' => '', 'exclude_cats' => '', 'clude_tags' => 'exclude', 'clude_cats' => 'exclude', 'tag_tax' => 'post_tag', 'category_tax' => 'category' );
    287303    $instance = wp_parse_args( (array) $instance, $defaults );             
    288304    ?>   
     
    381397      </label>   
    382398    </p> 
     399    <p>       
     400      <input type="checkbox" id="ctf-corresponding-tags" name="<?php echo $this->get_field_name('corresponding_tags'); ?>" value="1" <?php if ($instance['corresponding_tags'] == 1) echo "checked ";?>/>
     401      <label for="ctf-corresponding-tags">
     402        <?php _e('Show only corresponding tags for current category', 'cat-tag-filter'); ?>
     403      </label>   
     404    </p>
    383405    <p>   
    384406      <label for="ctf-exclude_tags">
  • cat-tag-filter-widget/trunk/languages/cat-tag-filter-ru_RU.po

    r607352 r609235  
    33"Project-Id-Version: Cat + Tag Filter\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2012-10-03 16:50+0800\n"
    6 "PO-Revision-Date: 2012-10-03 16:51+0800\n"
     5"POT-Creation-Date: 2012-10-08 01:30+0800\n"
     6"PO-Revision-Date: 2012-10-08 01:31+0800\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    1414"X-Poedit-SearchPath-0: ..\n"
    1515
    16 #: ../cat-tag-filter.php:172
    17 #: ../cat-tag-filter.php:192
     16#: ../cat-tag-filter.php:186
     17#: ../cat-tag-filter.php:206
    1818msgid "No tags here"
    1919msgstr "Здесь нет тегов"
    2020
    21 #: ../cat-tag-filter.php:178
    22 #: ../cat-tag-filter.php:236
    23 #: ../cat-tag-filter.php:286
     21#: ../cat-tag-filter.php:192
     22#: ../cat-tag-filter.php:250
     23#: ../cat-tag-filter.php:302
    2424msgid "Any tag"
    2525msgstr "Любым тегом"
    2626
    27 #: ../cat-tag-filter.php:231
     27#: ../cat-tag-filter.php:245
    2828msgid "Filter posts by category and tag"
    2929msgstr "Фильтр записей по категории и тегу"
    3030
    31 #: ../cat-tag-filter.php:236
    32 #: ../cat-tag-filter.php:286
     31#: ../cat-tag-filter.php:250
     32#: ../cat-tag-filter.php:302
    3333msgid "Filter"
    3434msgstr "Фильтр"
    3535
    36 #: ../cat-tag-filter.php:236
    37 #: ../cat-tag-filter.php:286
     36#: ../cat-tag-filter.php:250
     37#: ../cat-tag-filter.php:302
    3838msgid "Show posts"
    3939msgstr "Показать посты"
    4040
    41 #: ../cat-tag-filter.php:236
    42 #: ../cat-tag-filter.php:286
     41#: ../cat-tag-filter.php:250
     42#: ../cat-tag-filter.php:302
    4343msgid "Show posts from:"
    4444msgstr "Показать посты из:"
    4545
    46 #: ../cat-tag-filter.php:236
    47 #: ../cat-tag-filter.php:286
     46#: ../cat-tag-filter.php:250
     47#: ../cat-tag-filter.php:302
    4848msgid "With tag:"
    4949msgstr "С тегом:"
    5050
    51 #: ../cat-tag-filter.php:236
    52 #: ../cat-tag-filter.php:286
     51#: ../cat-tag-filter.php:250
     52#: ../cat-tag-filter.php:302
    5353msgid "Any category"
    5454msgstr "Любой категории"
    5555
    56 #: ../cat-tag-filter.php:296
     56#: ../cat-tag-filter.php:312
    5757msgid "Widget title"
    5858msgstr "Заголовок виджета"
    5959
    60 #: ../cat-tag-filter.php:304
     60#: ../cat-tag-filter.php:320
    6161msgid "Hide categories dropdown"
    6262msgstr "Спрятать выпадающий список категорий"
    6363
    64 #: ../cat-tag-filter.php:310
     64#: ../cat-tag-filter.php:326
    6565msgid "Categories dropdown label"
    6666msgstr "Надпись над категориями"
    6767
    68 #: ../cat-tag-filter.php:316
     68#: ../cat-tag-filter.php:332
    6969msgid "All categories option text"
    7070msgstr "Первый пункт в списке категорий"
    7171
    72 #: ../cat-tag-filter.php:323
     72#: ../cat-tag-filter.php:339
    7373msgid "Show categories post count"
    7474msgstr "Показывать счетчик постов в списке категорий"
    7575
    76 #: ../cat-tag-filter.php:328
     76#: ../cat-tag-filter.php:344
    7777msgid "Coma separated category id's to "
    7878msgstr "Id категорий через запятую, которые нужно"
    7979
    80 #: ../cat-tag-filter.php:330
    81 #: ../cat-tag-filter.php:387
     80#: ../cat-tag-filter.php:346
     81#: ../cat-tag-filter.php:409
    8282msgid "exclude"
    8383msgstr "исключить"
    8484
    85 #: ../cat-tag-filter.php:333
    86 #: ../cat-tag-filter.php:390
     85#: ../cat-tag-filter.php:349
     86#: ../cat-tag-filter.php:412
    8787msgid "include"
    8888msgstr "включить"
    8989
    90 #: ../cat-tag-filter.php:341
     90#: ../cat-tag-filter.php:357
    9191msgid "Tags dropdown label"
    9292msgstr "Надпись над тегами"
    9393
    94 #: ../cat-tag-filter.php:347
     94#: ../cat-tag-filter.php:363
    9595msgid "All tags option text"
    9696msgstr "Первый пункт в списке тегов"
    9797
    98 #: ../cat-tag-filter.php:353
     98#: ../cat-tag-filter.php:369
    9999msgid "How to show tags:"
    100100msgstr "Как показывать теги:"
    101101
    102 #: ../cat-tag-filter.php:357
     102#: ../cat-tag-filter.php:373
    103103msgid "Dropdown list"
    104104msgstr "Выпадающий список"
    105105
    106 #: ../cat-tag-filter.php:360
     106#: ../cat-tag-filter.php:376
    107107msgid "Checkboxes"
    108108msgstr "Чекбоксы"
    109109
    110 #: ../cat-tag-filter.php:366
     110#: ../cat-tag-filter.php:382
    111111msgid "Logic operator for multiple tags:"
    112112msgstr "Логический оператор при выборе нескольких тегов"
    113113
    114 #: ../cat-tag-filter.php:370
     114#: ../cat-tag-filter.php:386
    115115msgid "OR"
    116116msgstr "ИЛИ"
    117117
    118 #: ../cat-tag-filter.php:373
     118#: ../cat-tag-filter.php:389
    119119msgid "AND"
    120120msgstr "И"
    121121
    122 #: ../cat-tag-filter.php:380
     122#: ../cat-tag-filter.php:396
    123123msgid "Show tags post count"
    124124msgstr "Показывать счетчик постов в списке тегов"
    125125
    126 #: ../cat-tag-filter.php:385
     126#: ../cat-tag-filter.php:402
     127msgid "Show only corresponding tags for current category"
     128msgstr "Показывать только теги, использованные в данной категории"
     129
     130#: ../cat-tag-filter.php:407
    127131msgid "Coma separated tag id's to "
    128132msgstr "Id тегов через запятую, которые нужно"
    129133
    130 #: ../cat-tag-filter.php:397
     134#: ../cat-tag-filter.php:419
    131135msgid "Custom taxonomy name for tags"
    132136msgstr "Имя таксономии для тегов"
    133137
    134 #: ../cat-tag-filter.php:403
     138#: ../cat-tag-filter.php:425
    135139msgid "Custom taxonomy name for categories"
    136140msgstr "Имя таксономии для категорий"
    137141
    138 #: ../cat-tag-filter.php:407
     142#: ../cat-tag-filter.php:429
    139143msgid "List of registered taxonomies"
    140144msgstr "Список зарегистрированных таксономий"
    141145
    142 #: ../cat-tag-filter.php:416
     146#: ../cat-tag-filter.php:438
    143147msgid "Button title"
    144148msgstr "Надпись на кнопке"
  • cat-tag-filter-widget/trunk/languages/cat-tag-filter.po

    r607352 r609235  
    33"Project-Id-Version: Cat + Tag Filter\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2012-10-03 16:50+0800\n"
    6 "PO-Revision-Date: 2012-10-03 16:50+0800\n"
     5"POT-Creation-Date: 2012-10-08 01:30+0800\n"
     6"PO-Revision-Date: 2012-10-08 01:30+0800\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    1414"X-Poedit-SearchPath-0: ..\n"
    1515
    16 #: ../cat-tag-filter.php:172
    17 #: ../cat-tag-filter.php:192
     16#: ../cat-tag-filter.php:186
     17#: ../cat-tag-filter.php:206
    1818msgid "No tags here"
    1919msgstr ""
    2020
    21 #: ../cat-tag-filter.php:178
    22 #: ../cat-tag-filter.php:236
    23 #: ../cat-tag-filter.php:286
     21#: ../cat-tag-filter.php:192
     22#: ../cat-tag-filter.php:250
     23#: ../cat-tag-filter.php:302
    2424msgid "Any tag"
    2525msgstr ""
    2626
    27 #: ../cat-tag-filter.php:231
     27#: ../cat-tag-filter.php:245
    2828msgid "Filter posts by category and tag"
    2929msgstr ""
    3030
    31 #: ../cat-tag-filter.php:236
    32 #: ../cat-tag-filter.php:286
     31#: ../cat-tag-filter.php:250
     32#: ../cat-tag-filter.php:302
    3333msgid "Filter"
    3434msgstr ""
    3535
    36 #: ../cat-tag-filter.php:236
    37 #: ../cat-tag-filter.php:286
     36#: ../cat-tag-filter.php:250
     37#: ../cat-tag-filter.php:302
    3838msgid "Show posts"
    3939msgstr ""
    4040
    41 #: ../cat-tag-filter.php:236
    42 #: ../cat-tag-filter.php:286
     41#: ../cat-tag-filter.php:250
     42#: ../cat-tag-filter.php:302
    4343msgid "Show posts from:"
    4444msgstr ""
    4545
    46 #: ../cat-tag-filter.php:236
    47 #: ../cat-tag-filter.php:286
     46#: ../cat-tag-filter.php:250
     47#: ../cat-tag-filter.php:302
    4848msgid "With tag:"
    4949msgstr ""
    5050
    51 #: ../cat-tag-filter.php:236
    52 #: ../cat-tag-filter.php:286
     51#: ../cat-tag-filter.php:250
     52#: ../cat-tag-filter.php:302
    5353msgid "Any category"
    5454msgstr ""
    5555
    56 #: ../cat-tag-filter.php:296
     56#: ../cat-tag-filter.php:312
    5757msgid "Widget title"
    5858msgstr ""
    5959
    60 #: ../cat-tag-filter.php:304
     60#: ../cat-tag-filter.php:320
    6161msgid "Hide categories dropdown"
    6262msgstr ""
    6363
    64 #: ../cat-tag-filter.php:310
     64#: ../cat-tag-filter.php:326
    6565msgid "Categories dropdown label"
    6666msgstr ""
    6767
    68 #: ../cat-tag-filter.php:316
     68#: ../cat-tag-filter.php:332
    6969msgid "All categories option text"
    7070msgstr ""
    7171
    72 #: ../cat-tag-filter.php:323
     72#: ../cat-tag-filter.php:339
    7373msgid "Show categories post count"
    7474msgstr ""
    7575
    76 #: ../cat-tag-filter.php:328
     76#: ../cat-tag-filter.php:344
    7777msgid "Coma separated category id's to "
    7878msgstr ""
    7979
    80 #: ../cat-tag-filter.php:330
    81 #: ../cat-tag-filter.php:387
     80#: ../cat-tag-filter.php:346
     81#: ../cat-tag-filter.php:409
    8282msgid "exclude"
    8383msgstr ""
    8484
    85 #: ../cat-tag-filter.php:333
    86 #: ../cat-tag-filter.php:390
     85#: ../cat-tag-filter.php:349
     86#: ../cat-tag-filter.php:412
    8787msgid "include"
    8888msgstr ""
    8989
    90 #: ../cat-tag-filter.php:341
     90#: ../cat-tag-filter.php:357
    9191msgid "Tags dropdown label"
    9292msgstr ""
    9393
    94 #: ../cat-tag-filter.php:347
     94#: ../cat-tag-filter.php:363
    9595msgid "All tags option text"
    9696msgstr ""
    9797
    98 #: ../cat-tag-filter.php:353
     98#: ../cat-tag-filter.php:369
    9999msgid "How to show tags:"
    100100msgstr ""
    101101
    102 #: ../cat-tag-filter.php:357
     102#: ../cat-tag-filter.php:373
    103103msgid "Dropdown list"
    104104msgstr ""
    105105
    106 #: ../cat-tag-filter.php:360
     106#: ../cat-tag-filter.php:376
    107107msgid "Checkboxes"
    108108msgstr ""
    109109
    110 #: ../cat-tag-filter.php:366
     110#: ../cat-tag-filter.php:382
    111111msgid "Logic operator for multiple tags:"
    112112msgstr ""
    113113
    114 #: ../cat-tag-filter.php:370
     114#: ../cat-tag-filter.php:386
    115115msgid "OR"
    116116msgstr ""
    117117
    118 #: ../cat-tag-filter.php:373
     118#: ../cat-tag-filter.php:389
    119119msgid "AND"
    120120msgstr ""
    121121
    122 #: ../cat-tag-filter.php:380
     122#: ../cat-tag-filter.php:396
    123123msgid "Show tags post count"
    124124msgstr ""
    125125
    126 #: ../cat-tag-filter.php:385
     126#: ../cat-tag-filter.php:402
     127msgid "Show only corresponding tags for current category"
     128msgstr ""
     129
     130#: ../cat-tag-filter.php:407
    127131msgid "Coma separated tag id's to "
    128132msgstr ""
    129133
    130 #: ../cat-tag-filter.php:397
     134#: ../cat-tag-filter.php:419
    131135msgid "Custom taxonomy name for tags"
    132136msgstr ""
    133137
    134 #: ../cat-tag-filter.php:403
     138#: ../cat-tag-filter.php:425
    135139msgid "Custom taxonomy name for categories"
    136140msgstr ""
    137141
    138 #: ../cat-tag-filter.php:407
     142#: ../cat-tag-filter.php:429
    139143msgid "List of registered taxonomies"
    140144msgstr ""
    141145
    142 #: ../cat-tag-filter.php:416
     146#: ../cat-tag-filter.php:438
    143147msgid "Button title"
    144148msgstr ""
  • cat-tag-filter-widget/trunk/readme.txt

    r607352 r609235  
    55Requires at least: 2.8
    66Tested up to: 3.4.2
    7 Stable tag: 0.8.4
     7Stable tag: 0.8.5
    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.
     
    7575
    7676= 0.8.4 =
     77* Added an option to switch off corresponding tags mode.
     78* fixed layout in categories with no corresponding tags.
     79* fixed corresponding tags for categories with more than one page of posts.
     80
     81
     82= 0.8.4 =
    7783* fixed layout in categories with no corresponding tags.
    7884
Note: See TracChangeset for help on using the changeset viewer.