Skip Navigation
availability:

WPML Version: 3.2

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.

type:
filter
category:
Miscellaneous
parameters:
apply_filters( 'wpml_element_type', string $element_type )
$element_type
(string) (Required) Accepts comment, post, page, attachment, nav_menu_item, {custom post key}, nav_menu, category, post_tag, {custom taxonomy key}
hook example usage:

Example

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