@@ 1676-1694 (lines=19) @@ | ||
1673 | elseif ( 'taxonomy' == $object_type && $sitepress->is_translated_taxonomy( $object ) ) |
|
1674 | $translated = true; |
|
1675 | ||
1676 | if ( $translated ) { |
|
1677 | $object_id = icl_object_id( $result[ $search_data->field_id ], $object, false, $current_language ); |
|
1678 | ||
1679 | if ( 0 < $object_id && !in_array( $object_id, $ids ) ) { |
|
1680 | $text = $result[ $search_data->field_index ]; |
|
1681 | ||
1682 | if ( $result[ $search_data->field_id ] != $object_id ) { |
|
1683 | if ( $wpdb->posts == $search_data->table ) |
|
1684 | $text = trim( get_the_title( $object_id ) ); |
|
1685 | elseif ( $wpdb->terms == $search_data->table ) |
|
1686 | $text = trim( get_term( $object_id, $object )->name ); |
|
1687 | } |
|
1688 | ||
1689 | $result[ $search_data->field_id ] = $object_id; |
|
1690 | $result[ $search_data->field_index ] = $text; |
|
1691 | } |
|
1692 | else |
|
1693 | continue; |
|
1694 | } |
|
1695 | } |
|
1696 | // Polylang integration for Post Types and Taxonomies |
|
1697 | elseif ( is_object( $polylang ) && in_array( $object_type, array( 'post_type', 'taxonomy' ) ) && method_exists( $polylang, 'get_translation' ) ) { |
|
@@ 1705-1723 (lines=19) @@ | ||
1702 | elseif ( 'taxonomy' == $object_type && pll_is_translated_taxonomy( $object ) ) |
|
1703 | $translated = true; |
|
1704 | ||
1705 | if ( $translated ) { |
|
1706 | $object_id = $polylang->get_translation( $object, $result[ $search_data->field_id ], $current_language ); |
|
1707 | ||
1708 | if ( 0 < $object_id && !in_array( $object_id, $ids ) ) { |
|
1709 | $text = $result[ $search_data->field_index ]; |
|
1710 | ||
1711 | if ( $result[ $search_data->field_id ] != $object_id ) { |
|
1712 | if ( $wpdb->posts == $search_data->table ) |
|
1713 | $text = trim( get_the_title( $object_id ) ); |
|
1714 | elseif ( $wpdb->terms == $search_data->table ) |
|
1715 | $text = trim( get_term( $object_id, $object )->name ); |
|
1716 | } |
|
1717 | ||
1718 | $result[ $search_data->field_id ] = $object_id; |
|
1719 | $result[ $search_data->field_index ] = $text; |
|
1720 | } |
|
1721 | else |
|
1722 | continue; |
|
1723 | } |
|
1724 | } |
|
1725 | ||
1726 | if ( 0 < strlen( $display_filter ) ) { |