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