wpml_is_translated_post_type
- ประเภท
- filter
- หมวดหมู่
- การหาสถานะการแปลของเนื้อหา
- เวอร์ชันของ WPML
- 3.1.5
คำอธิบาย
ส่งคืนค่า TRUE หรือ FALSE ขึ้นอยู่กับว่าประเภทโพสต์ถูกตั้งค่าให้แปลได้หรือไม่
อาร์กิวเมนต์
apply_filters( 'wpml_is_translated_post_type', null, string $post_type )$post_type
(สตริง) (จำเป็น) ประเภทของโพสต์ที่คุณต้องการตรวจสอบ ซึ่งสามารถเป็น ประเภทโพสต์ใดก็ได้ เช่น โพสต์ หน้า ไฟล์แนบ หรือรุ่นปรับปรุง
สำหรับประเภทโพสต์แบบกำหนดเอง โปรดเพิ่ม slug ของประเภทโพสต์แบบกำหนดเอง
ตัวอย่างการใช้งาน
ตัวอย่าง
//$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' )
ฮุกที่เกี่ยวข้อง
wpml_element_translation_type, wpml_is_translated_taxonomy, wpml_master_post_from_duplicate, wpml_post_duplicates, wpml_element_has_translations