WPML
Chữ kýPHP
apply_filters( 'wpml_element_type', string $element_type )

Miêu tả

Lọc một loại phần tử WordPress (loại bài viết, thuật ngữ phân loại, bình luận) bằng cách thêm tiền tố WPML ‘post_’, ‘tax_’ (đối với các thẻ mặc định, sử dụng ‘post_tag’), hoặc không thêm gì cho ‘comment’ như được sử dụng trong bảng db icl_translations.

Tham số

  • $element_typestringBắt buộc

    Chấp nhận comment, post, page, attachment, nav_menu_item, {custom post key}, nav_menu, category, post_tag, {custom taxonomy key}

Ví dụ sử dụng

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