Recent

wpml_object_id filter

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

TypeNameDescription
int$term_idTerm ID in the default language.
string$taxonomyTaxonomy slug.

Usage

add_filter( 'wpml_object_id', function($term_id, $taxonomy) {
    // ...
    return $term_id;
} );