WPML
SignaturePHP
apply_filters( 'wpml_element_type', string $element_type )

Description

Filters a WordPress element type (post type, taxonomy term, comment) by adding the WPML prefix ‘post_’, ‘tax_’ (for default tags use ‘post_tag’), or nothing for ‘comment’ as used in the icl_translations db table.

Arguments

  • $element_typestringRequired

    Accepts comment, post, page, attachment, nav_menu_item, {custom post key}, nav_menu, category, post_tag, {custom taxonomy key}

Example Usage

PHP
//$wpml_element_type will return 'post_attachment'
$wpml_element_type = apply_filters( 'wpml_element_type', 'attachment' );