WPML
SignaturePHP
apply_filters( 'wpml_element_has_translations', mixed $empty_value, int $element_id, string $element_type )

Description

Returns TRUE or FALSE based on whether a post type or taxonomy term is translated or not.

Arguments

  • $empty_valuemixedRequired

    This is normally the value the filter will be modifying. We are not filtering anything here so set this to NULL. This for the filter function to actually receive the full argument list
  • $element_idintRequired

    The element id to retrieve the information of. Use term_id for taxonomy terms, post_id for post types
  • $element_typestringRequired

    The type of element the ID belongs to. 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

PHP
//$is_translated will be TRUE if the custom post is translated and FALSE if it is not translated
$is_translated = apply_filters( 'wpml_element_has_translations', NULL, 61, 'book' )