PluginProbe
Polylang / 2.6.2
Polylang v2.6.2
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | include/translated-object.php +2 -3 2.7.32.6.2 View file →
@@ -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