| @@ -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(); |