Version Description
= 2.3 =
- New features, see plugin page at wordpress.org for full details. Watch out for the changes in class names: https://github.com/rickard2/utcw/issues/29
= 2.2.3 =
- Fixed naming collision issue with other plugins
= 2.2.2 =
- Fixed widget initialization issue
= 2.2.1 =
- Fixes compatibility issue with PHP 5.2
= 2.2 =
- New features, see the plugin page at wordpress.org for full details
= 2.1 =
- New features, see the plugin page at wordpress.org for full details
= 2.0.1 =
- Small bug fix in the widget options panel
= 2.0 =
- New plugin architecture and a big rewrite of the plugin foundation. Watch out for breaking changes, please see http://exz.nu/utcwbreaking for more information.
Download this release
Release Info
Developer | exz |
Plugin | Ultimate Tag Cloud Widget |
Version | 2.3-beta3 |
Comparing to | |
See all releases |
Code changes from version 2.3-beta2 to 2.3-beta3
- readme.txt +1 -1
- src/Plugin.php +42 -9
readme.txt
CHANGED
@@ -99,7 +99,7 @@ The upgrade notice history for the 1.x branch is available on [GitHub](https://g
|
|
99 |
|
100 |
= 2.3 =
|
101 |
|
102 |
-
* New features, see plugin page at wordpress.org for full details
|
103 |
|
104 |
= 2.2.3 =
|
105 |
|
99 |
|
100 |
= 2.3 =
|
101 |
|
102 |
+
* New features, see plugin page at wordpress.org for full details. Watch out for the changes in class names: https://github.com/rickard2/utcw/issues/29
|
103 |
|
104 |
= 2.2.3 =
|
105 |
|
src/Plugin.php
CHANGED
@@ -62,15 +62,24 @@ class UTCW_Plugin
|
|
62 |
/**
|
63 |
* Initializes the WordPress hooks needed
|
64 |
*
|
65 |
-
* @todo Add tests that these hooks are set
|
66 |
* @since 2.0
|
67 |
*/
|
68 |
private function __construct()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
{
|
70 |
add_action('admin_head-widgets.php', array($this, 'initAdminAssets'));
|
71 |
add_action('wp_loaded', array($this, 'wpLoaded'));
|
72 |
-
add_action('widgets_init',
|
73 |
-
add_action('wp_ajax_utcw_get_terms', array($this, '
|
74 |
add_shortcode('utcw', array($this, 'shortcode'));
|
75 |
}
|
76 |
|
@@ -133,19 +142,43 @@ class UTCW_Plugin
|
|
133 |
*
|
134 |
* @since 2.3
|
135 |
*/
|
136 |
-
public function
|
137 |
-
|
138 |
header('Content-Type: application/json');
|
|
|
|
|
|
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
$terms = $this->getTerms();
|
141 |
|
142 |
-
|
|
|
|
|
|
|
143 |
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
}
|
146 |
|
147 |
/**
|
148 |
-
* Action handler for '
|
149 |
* Loads taxonomies and post types
|
150 |
*
|
151 |
* @since 2.0
|
@@ -157,7 +190,7 @@ class UTCW_Plugin
|
|
157 |
}
|
158 |
|
159 |
/**
|
160 |
-
*
|
161 |
*
|
162 |
* @param array $args
|
163 |
*
|
62 |
/**
|
63 |
* Initializes the WordPress hooks needed
|
64 |
*
|
|
|
65 |
* @since 2.0
|
66 |
*/
|
67 |
private function __construct()
|
68 |
+
{
|
69 |
+
$this->setHooks();
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Sets WordPress hooks
|
74 |
+
*
|
75 |
+
* @since 2.3
|
76 |
+
*/
|
77 |
+
public function setHooks()
|
78 |
{
|
79 |
add_action('admin_head-widgets.php', array($this, 'initAdminAssets'));
|
80 |
add_action('wp_loaded', array($this, 'wpLoaded'));
|
81 |
+
add_action('widgets_init', array($this, 'widgetsInit'));
|
82 |
+
add_action('wp_ajax_utcw_get_terms', array($this, 'outputTermsJson'));
|
83 |
add_shortcode('utcw', array($this, 'shortcode'));
|
84 |
}
|
85 |
|
142 |
*
|
143 |
* @since 2.3
|
144 |
*/
|
145 |
+
public function outputTermsJson()
|
146 |
+
{
|
147 |
header('Content-Type: application/json');
|
148 |
+
echo $this->getTermsJson();
|
149 |
+
die();
|
150 |
+
}
|
151 |
|
152 |
+
/**
|
153 |
+
* Returns terms in JSON format
|
154 |
+
*
|
155 |
+
* @since 2.3
|
156 |
+
*/
|
157 |
+
public function getTermsJson()
|
158 |
+
{
|
159 |
$terms = $this->getTerms();
|
160 |
|
161 |
+
// Convert terms into value array
|
162 |
+
foreach ($terms as $taxonomy => $items) {
|
163 |
+
$terms[$taxonomy] = array_values($items);
|
164 |
+
}
|
165 |
|
166 |
+
return json_encode($terms);
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Action handler for 'widgets_init' hook
|
171 |
+
* Registers the widget
|
172 |
+
*
|
173 |
+
* @since 2.3
|
174 |
+
*/
|
175 |
+
public function widgetsInit()
|
176 |
+
{
|
177 |
+
register_widget("UTCW_Widget");
|
178 |
}
|
179 |
|
180 |
/**
|
181 |
+
* Action handler for 'wp_loaded' hook
|
182 |
* Loads taxonomies and post types
|
183 |
*
|
184 |
* @since 2.0
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
+
* Short code handler for 'utcw' hook
|
194 |
*
|
195 |
* @param array $args
|
196 |
*
|