add_filter( 'wpml_ls_directories_to_scan', 'the_callback_function' );
- Loại
- filter
- Danh mục
- Khác
- Phiên bản WPML
- 3.6.0
Miêu tả
- Thêm các thư mục chứa mẫu bộ chuyển đổi ngôn ngữ.
- Hook này hữu ích khi các nhà phát triển muốn thêm thư mục riêng của họ thay vì thư mục mặc định
{your-theme-folder}/wpml/templates/language-switchers/. - Xem thêm tại tài liệu Thiết kế bộ chuyển đổi ngôn ngữ tùy chỉnh bằng tệp mẫu.
Đối số
Chỉ có một tham số được truyền cho bộ lọc này: dirs.- $dirs
- (mảng) Mảng chứa các thư mục.
Ví dụ sử dụng
Ví dụ
function wpmlhook_ls_dirs_to_scan( $dirs ) {
$dirs[] = __DIR__ . '/templates/';
return $dirs;
}
add_filter( 'wpml_ls_directories_to_scan', 'wpmlhook_ls_dirs_to_scan' );
Các hook liên quan
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