apply_filters( 'wpml_element_language_details', object $element_object, array $args )
Description
This filter hook will retrieve language information for a translatable element. It queries WPML’s icl_translations database table and returns an object with the element’s trid, source language code and language code.
If you are only looking for the element’s language code you might prefer to use wpml_element_language_code
Arguments
$element_objectobjectRequiredA WordPress object. Defaults to null.$argsarrayRequiredAn array of arguments to be used.element_idboolUse term_taxonomy_id for taxonomies, post_id for postselement_typestringThe type of element to check. Can be a post type: post, page, attachment, nav_menu_item, {custom post key} or taxonomy: category, post_tag, nav_menu {custom taxonomy key}
Example Usage
$args = array('element_id' => 10, 'element_type' => 'category' ); $my_category_language_info = apply_filters( 'wpml_element_language_details', null, $args );