| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * @package Polylang | |
| 4 | + */ | |
| 2 | 5 | |
| 3 | 6 | /** |
| 4 | 7 | * Setups the objects languages and translations model |
| 5 | 8 | * |
| @@ -42,8 +45,13 @@ | ||
| 42 | 45 | return false; |
| 43 | 46 | } |
| 44 | 47 | |
| 45 | 48 | $object_id = (int) $object_id; |
| 49 | + | |
| 50 | + if ( $object_id < 0 ) { | |
| 51 | + return false; | |
| 52 | + } | |
| 53 | + | |
| 46 | 54 | $term = get_object_term_cache( $object_id, $taxonomy ); |
| 47 | 55 | |
| 48 | 56 | if ( false === $term ) { |
| 49 | 57 | // query language and translations at the same time |