Skip to content

Commit

Permalink
Support for the new Polylang versions
Browse files Browse the repository at this point in the history
For now it doesn't matter mutch, but if or when ths $polylang object gets removes, this also passes when the new PLL() functions exists (Polylang 1.8+)
  • Loading branch information
JoryHogeveen committed Apr 26, 2016
1 parent d6e57ee commit 4805e5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/PodsAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -7454,7 +7454,7 @@ public function get_table_info ( $object_type, $object, $name = null, $pod = nul
$info[ 'where' ][ 'wpml_languages' ] = "`wpml_languages`.`code` IS NOT NULL";
}
// Polylang support
elseif( is_object( $polylang ) && !empty( $current_language ) && function_exists( 'pll_is_translated_post_type' ) && pll_is_translated_post_type( $post_type ) ) {
elseif( ( function_exists( 'PLL' ) || is_object( $polylang ) ) && !empty( $current_language ) && function_exists( 'pll_is_translated_post_type' ) && pll_is_translated_post_type( $post_type ) ) {
$info[ 'join' ][ 'polylang_languages' ] = "
LEFT JOIN `{$wpdb->term_relationships}` AS `polylang_languages`
ON `polylang_languages`.`object_id` = `t`.`ID`
Expand Down Expand Up @@ -7532,7 +7532,7 @@ public function get_table_info ( $object_type, $object, $name = null, $pod = nul
$info[ 'where' ][ 'wpml_languages' ] = "`wpml_languages`.`code` IS NOT NULL";
}
// Polylang support
elseif ( is_object( $polylang ) && !empty( $current_language ) && function_exists( 'pll_is_translated_taxonomy' ) && pll_is_translated_taxonomy( $taxonomy ) ) {
elseif ( ( function_exists( 'PLL' ) || is_object( $polylang ) ) && !empty( $current_language ) && function_exists( 'pll_is_translated_taxonomy' ) && pll_is_translated_taxonomy( $taxonomy ) ) {
$info[ 'join' ][ 'polylang_languages' ] = "
LEFT JOIN `{$wpdb->termmeta}` AS `polylang_languages`
ON `polylang_languages`.`term_id` = `t`.`term_id`
Expand Down

0 comments on commit 4805e5a

Please sign in to comment.