wpml_is_translated_post_type
- Loại
- filter
- Phiên bản WPML
- 3.1.5
Miêu tả
Trả về TRUE hoặc FALSE tùy thuộc vào việc một loại bài viết có được thiết lập là có thể dịch hay không.
Đối số
apply_filters( 'wpml_is_translated_post_type', null, string $post_type )$post_type
(chuỗi) (Bắt buộc) Loại bài viết bạn muốn kiểm tra. Nó có thể là bất kỳ loại bài viết nào, chẳng hạn như bài viết, trang, tệp đính kèm hoặc bản sửa đổi.
Đối với các loại nội dung tùy chỉnh, vui lòng thêm slug của loại nội dung tùy chỉnh.
Ví dụ sử dụng
Ví dụ
//$is_translated will be TRUE if the custom post is set to be translatable and FALSE if it is not set to be translatable $is_translated = apply_filters( 'wpml_is_translated_post_type', NULL, 'product' )
Các hook liên quan
wpml_element_translation_type, wpml_is_translated_taxonomy, wpml_master_post_from_duplicate, wpml_post_duplicates, wpml_element_has_translations