wpml_object_id
Translate a term ID to the current language.
Widget and shortcode settings store the term ID saved by the admin in the default language. On a non-default-language page the stored ID must be resolved to the equivalent term in the current language before use.
Type: filter
Since: 3.0.0
Source: includes/frontend/class-language-handler.php line 66
Parameters
| Type | Name | Description |
|---|---|---|
int | $term_id | Term ID in the default language. |
string | $taxonomy | Taxonomy slug. |
Usage
add_filter( 'wpml_object_id', function($term_id, $taxonomy) {
// ...
return $term_id;
} );