Plugin Directory

Changeset 1254953


Ignore:
Timestamp:
09/28/2015 09:39:40 AM (11 years ago)
Author:
benohead
Message:

Tagging version 1.7

Location:
wp-category-tag-could
Files:
1 added
6 edited
11 copied

Legend:

Unmodified
Added
Removed
  • wp-category-tag-could/tags/1.7/bootstrap.php

    r1254952 r1254953  
    44Plugin URI:  https://wordpress.org/plugins/wp-category-tag-could/
    55Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories.
    6 Version:     1.6
     6Version:     1.7
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-category-tag-could/tags/1.7/classes/wp-category-tag-cloud.php

    r1074315 r1254953  
    1212        protected $modified_types = array();
    1313
    14         const VERSION = '1.6';
     14        const VERSION = '1.7';
    1515        const PREFIX = 'wpctc_';
    1616        const DEBUG_MODE = false;
     
    9191                'all'
    9292            );
    93 
    94             error_log("bla=".print_r(WPCTC_Settings::get_instance()->settings['general']['do-not-load-scripts'], true));
    95             error_log("bla=".(!isset(WPCTC_Settings::get_instance()->settings['general']) ? "true" : "false"));
    96             error_log("bla=".(!isset(WPCTC_Settings::get_instance()->settings['general']['do-not-load-scripts']) ? "true" : "false"));
    97             error_log("bla=".(WPCTC_Settings::get_instance()->settings['general']['do-not-load-scripts'] != 1 ? "true" : "false"));
    9893
    9994            if ( is_admin() ) {
  • wp-category-tag-could/tags/1.7/classes/wpctc-widget.php

    r1074315 r1254953  
    2828    private function get_child_categories($cat_id)
    2929    {
     30        $category_list = array();
     31
    3032        $args = array(
    3133            'type' => 'post',
     
    3941        $child_categories = get_categories($args);
    4042
    41         $category_list = array();
    42 
    4343        if (!empty ($child_categories)) {
    4444            foreach ($child_categories as $child_category) {
     
    4646            }
    4747        }
    48 
    4948        return $category_list;
    5049    }
     
    5958        $category_list = array();
    6059        foreach ($categories as $cat_id) {
    61             $category_list[] = $cat_id;
    62             $category_list = array_merge($category_list, $this->get_child_categories($cat_id));
     60            if (!empty($cat_id)) {
     61                $category_list[] = $cat_id;
     62                $category_list = array_merge($category_list, $this->get_child_categories($cat_id));
     63            }
    6364        }
    6465
     
    152153                        . " INNER JOIN $wpdb->term_taxonomy as tt_" . $custom_taxonomy->name . " ON tr_" . $custom_taxonomy->name . ".term_taxonomy_id = tt_" . $custom_taxonomy->name . ".term_taxonomy_id ";
    153154                    $where = $where . " AND tt_" . $custom_taxonomy->name . ".taxonomy = '" . $custom_taxonomy->name . "'" .
    154                         " AND tt_" . $custom_taxonomy->name . ".term_id IN (" . implode(",", $instance[$custom_taxonomy->name . '_id']) . ") ";
     155                        " AND tt_" . $custom_taxonomy->name . ".term_id IN (" . str_replace(",,", ",", implode(",", $instance[$custom_taxonomy->name . '_id'])) . ") ";
    155156                }
    156157            }
     
    160161            $from = $from . " INNER JOIN $wpdb->term_relationships as tr1 ON posts.ID = tr1.object_ID
    161162                INNER JOIN $wpdb->term_taxonomy as tt1 ON tr1.term_taxonomy_id = tt1.term_taxonomy_id ";
    162             $where = $where . " AND tt1.taxonomy = 'category' AND tt1.term_id IN (" . implode(",", $instance['category_id']) . ") ";
     163            $where = $where . " AND tt1.taxonomy = 'category' AND tt1.term_id IN (" . str_replace(",,", ",", implode(",", $instance['category_id'])) . ") ";
    163164        }
    164165        if (isset($instance['tag_id']) && count($instance['tag_id']) > 0) {
    165166            $from = $from . " INNER JOIN $wpdb->term_relationships as tr3 ON posts.ID = tr3.object_ID
    166167                INNER JOIN $wpdb->term_taxonomy as tt3 ON tr3.term_taxonomy_id = tt3.term_taxonomy_id ";
    167             $where = $where . " AND tt3.taxonomy = 'post_tag' AND tt3.term_id IN (" . implode(",", $instance['tag_id']) . ") ";
     168            $where = $where . " AND tt3.taxonomy = 'post_tag' AND tt3.term_id IN (" . str_replace(",,", ",", implode(",", $instance['tag_id'])) . ") ";
    168169        }
    169170        if (isset($instance['post_type']) && count($instance['post_type']) > 0) {
    170             $where = $where . " AND posts.post_type IN ('" . implode("','", $instance['post_type']) . "') ";
     171            $where = $where . " AND posts.post_type IN ('" . str_replace(",,", ",", implode("','", $instance['post_type'])) . "') ";
    171172        }
    172173        if (isset($instance['author']) && count($instance['author']) > 0) {
    173             $where = $where . " AND posts.post_author IN ('" . implode("','", $instance['author']) . "') ";
     174            $where = $where . " AND posts.post_author IN ('" . str_replace(",,", ",", implode("','", $instance['author'])) . "') ";
    174175        }
    175176
     
    181182            $where = $where . " GROUP BY tag_id HAVING count(distinct posts.ID) >= ".intval($instance['post_count']);
    182183        }
    183        
     184
    184185        $tags = $wpdb->get_results
    185186        (" SELECT DISTINCT tt2.term_id AS tag_id
  • wp-category-tag-could/tags/1.7/readme.txt

    r1254952 r1254953  
    55Requires at least: 3.0.1
    66Tested up to: 4.1
    7 Stable tag: 1.6
     7Stable tag: 1.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    105105Let's assume this is the shortcode which was generated:
    106106
    107         [showtagcloud taxomony="category", format="array", number="20", color="#FF5800", background="FFFFFF"]
     107        [showtagcloud taxonomy="category" format="array" number="20" color="#FF5800" background="FFFFFF"]
    108108
    109109Since the arguments of the shortcode are the same arguments as the ones of the show_tag_cloud() function, you can then copy them. So in the example above copy the following: taxomony="category", format="array", number="20", color="#FF5800", background="FFFFFF"
     
    160160
    161161== Changelog ==
     162
     163= 1.7 =
     164
     165* Removed calls to error_log
     166* Fixed example for short code
    162167
    163168= 1.6 =
  • wp-category-tag-could/trunk/bootstrap.php

    r1074315 r1254953  
    44Plugin URI:  https://wordpress.org/plugins/wp-category-tag-could/
    55Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories.
    6 Version:     1.6
     6Version:     1.7
    77Author:      Henri Benoit
    88Author URI:  http://benohead.com
  • wp-category-tag-could/trunk/classes/wp-category-tag-cloud.php

    r1074315 r1254953  
    1212        protected $modified_types = array();
    1313
    14         const VERSION = '1.6';
     14        const VERSION = '1.7';
    1515        const PREFIX = 'wpctc_';
    1616        const DEBUG_MODE = false;
     
    9191                'all'
    9292            );
    93 
    94             error_log("bla=".print_r(WPCTC_Settings::get_instance()->settings['general']['do-not-load-scripts'], true));
    95             error_log("bla=".(!isset(WPCTC_Settings::get_instance()->settings['general']) ? "true" : "false"));
    96             error_log("bla=".(!isset(WPCTC_Settings::get_instance()->settings['general']['do-not-load-scripts']) ? "true" : "false"));
    97             error_log("bla=".(WPCTC_Settings::get_instance()->settings['general']['do-not-load-scripts'] != 1 ? "true" : "false"));
    9893
    9994            if ( is_admin() ) {
  • wp-category-tag-could/trunk/classes/wpctc-widget.php

    r1074315 r1254953  
    2828    private function get_child_categories($cat_id)
    2929    {
     30        $category_list = array();
     31
    3032        $args = array(
    3133            'type' => 'post',
     
    3941        $child_categories = get_categories($args);
    4042
    41         $category_list = array();
    42 
    4343        if (!empty ($child_categories)) {
    4444            foreach ($child_categories as $child_category) {
     
    4646            }
    4747        }
    48 
    4948        return $category_list;
    5049    }
     
    5958        $category_list = array();
    6059        foreach ($categories as $cat_id) {
    61             $category_list[] = $cat_id;
    62             $category_list = array_merge($category_list, $this->get_child_categories($cat_id));
     60            if (!empty($cat_id)) {
     61                $category_list[] = $cat_id;
     62                $category_list = array_merge($category_list, $this->get_child_categories($cat_id));
     63            }
    6364        }
    6465
     
    152153                        . " INNER JOIN $wpdb->term_taxonomy as tt_" . $custom_taxonomy->name . " ON tr_" . $custom_taxonomy->name . ".term_taxonomy_id = tt_" . $custom_taxonomy->name . ".term_taxonomy_id ";
    153154                    $where = $where . " AND tt_" . $custom_taxonomy->name . ".taxonomy = '" . $custom_taxonomy->name . "'" .
    154                         " AND tt_" . $custom_taxonomy->name . ".term_id IN (" . implode(",", $instance[$custom_taxonomy->name . '_id']) . ") ";
     155                        " AND tt_" . $custom_taxonomy->name . ".term_id IN (" . str_replace(",,", ",", implode(",", $instance[$custom_taxonomy->name . '_id'])) . ") ";
    155156                }
    156157            }
     
    160161            $from = $from . " INNER JOIN $wpdb->term_relationships as tr1 ON posts.ID = tr1.object_ID
    161162                INNER JOIN $wpdb->term_taxonomy as tt1 ON tr1.term_taxonomy_id = tt1.term_taxonomy_id ";
    162             $where = $where . " AND tt1.taxonomy = 'category' AND tt1.term_id IN (" . implode(",", $instance['category_id']) . ") ";
     163            $where = $where . " AND tt1.taxonomy = 'category' AND tt1.term_id IN (" . str_replace(",,", ",", implode(",", $instance['category_id'])) . ") ";
    163164        }
    164165        if (isset($instance['tag_id']) && count($instance['tag_id']) > 0) {
    165166            $from = $from . " INNER JOIN $wpdb->term_relationships as tr3 ON posts.ID = tr3.object_ID
    166167                INNER JOIN $wpdb->term_taxonomy as tt3 ON tr3.term_taxonomy_id = tt3.term_taxonomy_id ";
    167             $where = $where . " AND tt3.taxonomy = 'post_tag' AND tt3.term_id IN (" . implode(",", $instance['tag_id']) . ") ";
     168            $where = $where . " AND tt3.taxonomy = 'post_tag' AND tt3.term_id IN (" . str_replace(",,", ",", implode(",", $instance['tag_id'])) . ") ";
    168169        }
    169170        if (isset($instance['post_type']) && count($instance['post_type']) > 0) {
    170             $where = $where . " AND posts.post_type IN ('" . implode("','", $instance['post_type']) . "') ";
     171            $where = $where . " AND posts.post_type IN ('" . str_replace(",,", ",", implode("','", $instance['post_type'])) . "') ";
    171172        }
    172173        if (isset($instance['author']) && count($instance['author']) > 0) {
    173             $where = $where . " AND posts.post_author IN ('" . implode("','", $instance['author']) . "') ";
     174            $where = $where . " AND posts.post_author IN ('" . str_replace(",,", ",", implode("','", $instance['author'])) . "') ";
    174175        }
    175176
     
    181182            $where = $where . " GROUP BY tag_id HAVING count(distinct posts.ID) >= ".intval($instance['post_count']);
    182183        }
    183        
     184
    184185        $tags = $wpdb->get_results
    185186        (" SELECT DISTINCT tt2.term_id AS tag_id
  • wp-category-tag-could/trunk/readme.txt

    r1074315 r1254953  
    55Requires at least: 3.0.1
    66Tested up to: 4.1
    7 Stable tag: 1.6
     7Stable tag: 1.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    105105Let's assume this is the shortcode which was generated:
    106106
    107         [showtagcloud taxomony="category", format="array", number="20", color="#FF5800", background="FFFFFF"]
     107        [showtagcloud taxonomy="category" format="array" number="20" color="#FF5800" background="FFFFFF"]
    108108
    109109Since the arguments of the shortcode are the same arguments as the ones of the show_tag_cloud() function, you can then copy them. So in the example above copy the following: taxomony="category", format="array", number="20", color="#FF5800", background="FFFFFF"
     
    160160
    161161== Changelog ==
     162
     163= 1.7 =
     164
     165* Removed calls to error_log
     166* Fixed example for short code
    162167
    163168= 1.6 =
Note: See TracChangeset for help on using the changeset viewer.