add_filter( 'wpml_ls_directories_to_scan', 'the_callback_function' );
- ประเภท
- filter
- หมวดหมู่
- เบ็ดเตล็ด
- เวอร์ชันของ WPML
- 3.6.0
คำอธิบาย
- เพิ่มไดเรกทอรีที่มีเทมเพลตตัวสลับภาษา
- ฮุกนี้มีประโยชน์เมื่อนักพัฒนาต้องการเพิ่มไดเรกทอรีของตนเองแทนไดเรกทอรีเริ่มต้น
{your-theme-folder}/wpml/templates/language-switchers/ - ดูข้อมูลเพิ่มเติมได้ที่เอกสาร การออกแบบตัวสลับภาษาแบบกำหนดเองโดยใช้ไฟล์เทมเพลต
อาร์กิวเมนต์
มีเพียงหนึ่งพารามิเตอร์ที่ส่งผ่านไปยังฟิลเตอร์นี้: dirs- $dirs
- (array) อาร์เรย์ที่รวมไดเรกทอรี
ตัวอย่างการใช้งาน
ตัวอย่าง
function wpmlhook_ls_dirs_to_scan( $dirs ) {
$dirs[] = __DIR__ . '/templates/';
return $dirs;
}
add_filter( 'wpml_ls_directories_to_scan', 'wpmlhook_ls_dirs_to_scan' );
ฮุกที่เกี่ยวข้อง
icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_element_type, wpml_setting, wpml_sub_setting, wpml_exclude_post_from_auto_translate, wpml_forms_config_ninja-forms, wpml_forms_config_wpforms, wpml_tf_feedback_open_link