| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * @package Polylang | |
| 4 | - */ | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * A class to manage the sychronization of taxonomy terms across posts translations |
| 8 | 5 | * |
| @@ -165,14 +162,9 @@ | ||
| 165 | 162 | $this->copy_object_terms( $object_id, $tr_id, $lang, $terms, $taxonomy, $append ); |
| 166 | 163 | } else { |
| 167 | 164 | // No permission to synchronize, so let's synchronize in reverse order |
| 168 | 165 | $orig_lang = array_search( $object_id, $tr_ids ); |
| 169 | - $tr_terms = get_the_terms( $tr_id, $taxonomy ); | |
| 170 | - | |
| 171 | - if ( false === $tr_terms ) { | |
| 172 | - $tr_terms = array(); | |
| 173 | - } | |
| 174 | - | |
| 166 | + $tr_terms = (array) get_the_terms( $tr_id, $taxonomy ); | |
| 175 | 167 | if ( is_array( $tr_terms ) ) { |
| 176 | 168 | $tr_terms = wp_list_pluck( $tr_terms, 'term_id' ); |
| 177 | 169 | $this->copy_object_terms( $tr_id, $object_id, $orig_lang, $tr_terms, $taxonomy, $append ); |
| 178 | 170 | } |