| @@ -49,9 +49,8 @@ | ||
| 49 | 49 | // query language and translations at the same time |
| 50 | 50 | $taxonomies = array( $this->tax_language, $this->tax_translations ); |
| 51 | 51 | |
| 52 | 52 | // query terms |
| 53 | - $terms = array(); | |
| 54 | 53 | foreach ( wp_get_object_terms( $object_id, $taxonomies, array( 'update_term_meta_cache' => false ) ) as $t ) { |
| 55 | 54 | $terms[ $t->taxonomy ] = $t; |
| 56 | 55 | if ( $t->taxonomy == $taxonomy ) { |
| 57 | 56 | $term = $t; |
| @@ -239,8 +238,9 @@ | ||
| 239 | 238 | * @param object|array|string $lang a PLL_Language object or a comma separated list of language slug or an array of language slugs |
| 240 | 239 | * @return string where clause |
| 241 | 240 | */ |
| 242 | 241 | public function where_clause( $lang ) { |
| 242 | + global $wpdb; | |
| 243 | 243 | $tt_id = $this->tax_tt; |
| 244 | 244 | |
| 245 | 245 | // $lang is an object |
| 246 | 246 | // generally the case if the query is coming from Polylang |
| @@ -249,10 +249,9 @@ | ||
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | // $lang is a comma separated list of slugs ( or an array of slugs ) |
| 252 | 252 | // generally the case is the query is coming from outside with 'lang' parameter |
| 253 | - $slugs = is_array( $lang ) ? $lang : explode( ',', $lang ); | |
| 254 | - $languages = array(); | |
| 253 | + $slugs = is_array( $lang ) ? $lang : explode( ',', $lang ); | |
| 255 | 254 | foreach ( $slugs as $slug ) { |
| 256 | 255 | $languages[] = absint( $this->model->get_language( $slug )->$tt_id ); |
| 257 | 256 | } |
| 258 | 257 | |