PluginProbe
WP Ultimate Post Grid / 2.0
WP Ultimate Post Grid v2.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
← All changes | helpers/grid_cache.php +6 -50 2.22.0 View file →
@@ -231,18 +231,13 @@
231 231
232 232 // Terms per post
233 233 $post_taxonomy_term_ids[] = $slug;
234 234
235 - if( !array_key_exists( $slug, $filter_terms ) ) {
236 - // Filter terms
237 - $filter_terms[$slug] = array(
238 - 'taxonomy' => $taxonomy,
239 - 'name' => $term->name,
240 - 'count' => 1,
241 - );
242 - } else {
243 - $filter_terms[$slug]['count']++;
244 - }
235 + // Filter terms
236 + $filter_terms[$slug] = array(
237 + 'taxonomy' => $taxonomy,
238 + 'name' => $term->name,
239 + );
245 240 }
246 241
247 242 $terms_per_post[$post_id][$taxonomy] = $post_taxonomy_term_ids;
248 243 }
@@ -247,41 +242,8 @@
247 242 $terms_per_post[$post_id][$taxonomy] = $post_taxonomy_term_ids;
248 243 }
249 244 }
250 245
251 - // Show Empty Terms
252 - if( $grid->filter_show_empty() ) {
253 - foreach( $taxonomies as $taxonomy ) {
254 - $terms = get_terms( $taxonomy, array(
255 - 'hide_empty' => false,
256 - ) );
257 -
258 - foreach( $terms as $term ) {
259 - // Check if terms are being limited
260 - if( $grid->filter_limit() ) {
261 - if( $grid->filter_limit_exclude() ) {
262 - if( isset( $limit_terms[$taxonomy] ) && in_array( $term->term_id, $limit_terms[$taxonomy] ) ) continue;
263 - } else {
264 - if( !isset( $limit_terms[$taxonomy] ) || !in_array( $term->term_id, $limit_terms[$taxonomy] ) ) continue;
265 - }
266 - }
267 -
268 - $slug = urldecode( $term->slug );
269 -
270 - if( !isset( $posts_per_term[$taxonomy][$slug] ) ) $posts_per_term[$taxonomy][$slug] = array();
271 -
272 - if( !array_key_exists( $slug, $filter_terms ) ) {
273 - // Filter terms
274 - $filter_terms[$slug] = array(
275 - 'taxonomy' => $taxonomy,
276 - 'name' => $term->name,
277 - 'count' => 0,
278 - );
279 - }
280 - }
281 - }
282 - }
283 -
284 246 $cache['taxonomies'] = $posts_per_term;
285 247 $cache['terms'] = $terms_per_post;
286 248
287 249 // Generate Filter
@@ -302,15 +264,9 @@
302 264 foreach( $filter_terms_order as $slug ) {
303 265 $options = isset( $filter_terms[$slug] ) ? $filter_terms[$slug] : false;
304 266
305 267 if( $options ) {
306 - if( $grid->filter_count() ) {
307 - $name = $options['name'] . ' (' . $options['count'] . ')';
308 - } else {
309 - $name = $options['name'];
310 - }
311 -
312 - $filter .= '<div class="wpupg-filter-item wpupg-filter-isotope-term wpupg-filter-tag-' . $slug . '" data-taxonomy="' . $options['taxonomy'] . '" data-filter="' . $slug . '">' . $name . '</div>';
268 + $filter .= '<div class="wpupg-filter-item wpupg-filter-isotope-term wpupg-filter-tag-' . $slug . '" data-taxonomy="' . $options['taxonomy'] . '" data-filter="' . $slug . '">' . $options['name'] . '</div>';
313 269 }
314 270 }
315 271 }
316 272