Sauter la navigation

WPML Version: 3.3.5

  • Get trid (the ID of the translation group) of a translated element, which is required for the  wpml_get_element_translations filter and others which expect this argument.
  • Learn more about trid on the WPML’s tables documentation page.
Site-Wide Language Information
apply_filters( 'wpml_element_trid', mixed $empty_value, integer $element_id, string $element_type)
(mixed) (Required) This is usually the value the filter will be modifying. We are not filtering anything here so set this to NULL. This is needed for the filter function to actually receive the full argument list.
(integer) (Required) The ID of the item (post_id for post types, term_taxonomy_id for taxonomy terms).
(string) (Optional) The type of an element. Can be a post type: post_post, post_page, post_attachment, post_nav_menu_item, post_{custom post key} or taxonomy: tax_category, tax_post_tag, tax_nav_menu, tax_{custom taxonomy key}. Defaults to post_post if not set.
hook example usage:


// Get "trid" of the "Sample Page" page. 
$trid = apply_filters( 'wpml_element_trid', NULL, 2, 'post_page' );