add_filter( 'wpml_ls_directories_to_scan', 'the_callback_function' );
- Type
- filter
- Category
- Miscellaneous
- WPML Version
- 3.6.0
Description
- Add directories containing language switcher templates.
- This hook is useful when developers want to add their own directories instead of the default directory
{your-theme-folder}/wpml/templates/language-switchers/. - See more at the Designing Custom Language Switchers Using Template Files document.
Arguments
There is only one parameter passed to this filter: dirs.- $dirs
- (array) The array including directories.
Example usage
Example
function wpmlhook_ls_dirs_to_scan( $dirs ) {
$dirs[] = __DIR__ . '/templates/';
return $dirs;
}
add_filter( 'wpml_ls_directories_to_scan', 'wpmlhook_ls_dirs_to_scan' );
Related hooks
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