Changeset 1254953
- Timestamp:
- 09/28/2015 09:39:40 AM (11 years ago)
- Location:
- wp-category-tag-could
- Files:
-
- 1 added
- 6 edited
- 11 copied
-
tags/1.7 (added)
-
tags/1.7/bootstrap.php (copied) (copied from wp-category-tag-could/trunk/bootstrap.php) (1 diff)
-
tags/1.7/classes (copied) (copied from wp-category-tag-could/trunk/classes)
-
tags/1.7/classes/wp-category-tag-cloud.php (modified) (2 diffs)
-
tags/1.7/classes/wpctc-widget.php (modified) (7 diffs)
-
tags/1.7/css (copied) (copied from wp-category-tag-could/trunk/css)
-
tags/1.7/javascript (copied) (copied from wp-category-tag-could/trunk/javascript)
-
tags/1.7/readme.txt (copied) (copied from wp-category-tag-could/trunk/readme.txt) (3 diffs)
-
tags/1.7/screenshot-1.png (copied) (copied from wp-category-tag-could/trunk/screenshot-1.png)
-
tags/1.7/screenshot-2.gif (copied) (copied from wp-category-tag-could/trunk/screenshot-2.gif)
-
tags/1.7/screenshot-3.png (copied) (copied from wp-category-tag-could/trunk/screenshot-3.png)
-
tags/1.7/screenshot-4.png (copied) (copied from wp-category-tag-could/trunk/screenshot-4.png)
-
tags/1.7/screenshot-5.png (copied) (copied from wp-category-tag-could/trunk/screenshot-5.png)
-
tags/1.7/views (copied) (copied from wp-category-tag-could/trunk/views)
-
trunk/bootstrap.php (modified) (1 diff)
-
trunk/classes/wp-category-tag-cloud.php (modified) (2 diffs)
-
trunk/classes/wpctc-widget.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-category-tag-could/tags/1.7/bootstrap.php
r1254952 r1254953 4 4 Plugin URI: https://wordpress.org/plugins/wp-category-tag-could/ 5 5 Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories. 6 Version: 1. 66 Version: 1.7 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-category-tag-could/tags/1.7/classes/wp-category-tag-cloud.php
r1074315 r1254953 12 12 protected $modified_types = array(); 13 13 14 const VERSION = '1. 6';14 const VERSION = '1.7'; 15 15 const PREFIX = 'wpctc_'; 16 16 const DEBUG_MODE = false; … … 91 91 'all' 92 92 ); 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"));98 93 99 94 if ( is_admin() ) { -
wp-category-tag-could/tags/1.7/classes/wpctc-widget.php
r1074315 r1254953 28 28 private function get_child_categories($cat_id) 29 29 { 30 $category_list = array(); 31 30 32 $args = array( 31 33 'type' => 'post', … … 39 41 $child_categories = get_categories($args); 40 42 41 $category_list = array();42 43 43 if (!empty ($child_categories)) { 44 44 foreach ($child_categories as $child_category) { … … 46 46 } 47 47 } 48 49 48 return $category_list; 50 49 } … … 59 58 $category_list = array(); 60 59 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 } 63 64 } 64 65 … … 152 153 . " 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 "; 153 154 $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'])) . ") "; 155 156 } 156 157 } … … 160 161 $from = $from . " INNER JOIN $wpdb->term_relationships as tr1 ON posts.ID = tr1.object_ID 161 162 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'])) . ") "; 163 164 } 164 165 if (isset($instance['tag_id']) && count($instance['tag_id']) > 0) { 165 166 $from = $from . " INNER JOIN $wpdb->term_relationships as tr3 ON posts.ID = tr3.object_ID 166 167 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'])) . ") "; 168 169 } 169 170 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'])) . "') "; 171 172 } 172 173 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'])) . "') "; 174 175 } 175 176 … … 181 182 $where = $where . " GROUP BY tag_id HAVING count(distinct posts.ID) >= ".intval($instance['post_count']); 182 183 } 183 184 184 185 $tags = $wpdb->get_results 185 186 (" SELECT DISTINCT tt2.term_id AS tag_id -
wp-category-tag-could/tags/1.7/readme.txt
r1254952 r1254953 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.1 7 Stable tag: 1. 67 Stable tag: 1.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 105 105 Let's assume this is the shortcode which was generated: 106 106 107 [showtagcloud taxo mony="category", format="array", number="20", color="#FF5800",background="FFFFFF"]107 [showtagcloud taxonomy="category" format="array" number="20" color="#FF5800" background="FFFFFF"] 108 108 109 109 Since 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" … … 160 160 161 161 == Changelog == 162 163 = 1.7 = 164 165 * Removed calls to error_log 166 * Fixed example for short code 162 167 163 168 = 1.6 = -
wp-category-tag-could/trunk/bootstrap.php
r1074315 r1254953 4 4 Plugin URI: https://wordpress.org/plugins/wp-category-tag-could/ 5 5 Description: Display a configurable cloud of tags, categories or any other taxonomy filtered by tags or categories. 6 Version: 1. 66 Version: 1.7 7 7 Author: Henri Benoit 8 8 Author URI: http://benohead.com -
wp-category-tag-could/trunk/classes/wp-category-tag-cloud.php
r1074315 r1254953 12 12 protected $modified_types = array(); 13 13 14 const VERSION = '1. 6';14 const VERSION = '1.7'; 15 15 const PREFIX = 'wpctc_'; 16 16 const DEBUG_MODE = false; … … 91 91 'all' 92 92 ); 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"));98 93 99 94 if ( is_admin() ) { -
wp-category-tag-could/trunk/classes/wpctc-widget.php
r1074315 r1254953 28 28 private function get_child_categories($cat_id) 29 29 { 30 $category_list = array(); 31 30 32 $args = array( 31 33 'type' => 'post', … … 39 41 $child_categories = get_categories($args); 40 42 41 $category_list = array();42 43 43 if (!empty ($child_categories)) { 44 44 foreach ($child_categories as $child_category) { … … 46 46 } 47 47 } 48 49 48 return $category_list; 50 49 } … … 59 58 $category_list = array(); 60 59 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 } 63 64 } 64 65 … … 152 153 . " 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 "; 153 154 $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'])) . ") "; 155 156 } 156 157 } … … 160 161 $from = $from . " INNER JOIN $wpdb->term_relationships as tr1 ON posts.ID = tr1.object_ID 161 162 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'])) . ") "; 163 164 } 164 165 if (isset($instance['tag_id']) && count($instance['tag_id']) > 0) { 165 166 $from = $from . " INNER JOIN $wpdb->term_relationships as tr3 ON posts.ID = tr3.object_ID 166 167 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'])) . ") "; 168 169 } 169 170 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'])) . "') "; 171 172 } 172 173 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'])) . "') "; 174 175 } 175 176 … … 181 182 $where = $where . " GROUP BY tag_id HAVING count(distinct posts.ID) >= ".intval($instance['post_count']); 182 183 } 183 184 184 185 $tags = $wpdb->get_results 185 186 (" SELECT DISTINCT tt2.term_id AS tag_id -
wp-category-tag-could/trunk/readme.txt
r1074315 r1254953 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.1 7 Stable tag: 1. 67 Stable tag: 1.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 105 105 Let's assume this is the shortcode which was generated: 106 106 107 [showtagcloud taxo mony="category", format="array", number="20", color="#FF5800",background="FFFFFF"]107 [showtagcloud taxonomy="category" format="array" number="20" color="#FF5800" background="FFFFFF"] 108 108 109 109 Since 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" … … 160 160 161 161 == Changelog == 162 163 = 1.7 = 164 165 * Removed calls to error_log 166 * Fixed example for short code 162 167 163 168 = 1.6 =
Note: See TracChangeset
for help on using the changeset viewer.