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 +9 -0 1.92.0 View file →
@@ -100,8 +100,16 @@
100 100 update_post_meta( $grid->ID(), 'wpupg_filter', $generated['filter'] );
101 101 }
102 102
103 103 public function dynamic_generate( $grid ) {
104 + // Don't cache term grid
105 + if( $grid->type() == 'terms' ) {
106 + return array(
107 + 'cache' => array(),
108 + 'filter' => '',
109 + );
110 + }
111 +
104 112 // Get Posts
105 113 $args = array(
106 114 'post_type' => $grid->post_types(),
107 115 'post_status' => $grid->post_status(),
@@ -164,8 +172,9 @@
164 172 foreach( $taxonomies as $taxonomy ) {
165 173 if( !isset( $posts_per_term[$taxonomy] ) ) $posts_per_term[$taxonomy] = array();
166 174
167 175 $terms = wp_get_post_terms( $post_id, $taxonomy );
176 + $terms = is_wp_error( $terms ) ? array() : $terms;
168 177
169 178 // Get parent terms if enabled
170 179 if( $grid->filter_match_parents() ) {
171 180 $parent_ids = array();