WPML
apply_filters( 'wpml_language_is_active', mixed $empty_value, string $language_code )
ประเภท
filter
เวอร์ชันของ WPML
3.2

คำอธิบาย

คืนค่า TRUE หรือ FALSE หากมีการเปิดใช้งานภาษาที่ระบุ

อาร์กิวเมนต์

$empty_value
(mixed) (จำเป็น) โดยปกติแล้ว นี่คือค่าที่ฟิลเตอร์จะแก้ไข เราไม่ได้กรองสิ่งใดที่นี่ ดังนั้นให้ตั้งค่านี้เป็น NULL สิ่งนี้มีไว้เพื่อให้ฟังก์ชันฟิลเตอร์ได้รับรายการอาร์กิวเมนต์แบบเต็ม
$language_code
(string) (จำเป็น) รหัสภาษาที่ต้องการตรวจสอบ ยอมรับรหัส 2 ตัวอักษร เช่น ‘en’

ตัวอย่างการใช้งาน

ตัวอย่าง
// $is_german_enabled will return TRUE if German is enabled and FALSE if not
$is_german_enabled = apply_filters( 'wpml_language_is_active', NULL, 'de' );

wpml_decode_custom_field, wpml_footer_language_selector, wpml_add_language_form_field, wpml_ls_exclude_in_menu, wpml_is_rtl, wpml_alternate_hreflang, wpml_head_langs, wpml_must_translate_canonical_url, wpml_browser_redirect_language_params, wpml_active_languages

ฮุก ข้อมูลภาษาทั่วทั้งไซต์ ทั้งหมด 29 รายการ →