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