- availability:
-
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.
- type:
- filter
- category:
- Miscellaneous
- parameters:
-
add_filter( 'wpml_ls_directories_to_scan', 'the_callback_function' );
There is only one parameter passed to this filter: dirs.
- $dirs
- (array) The array including directories.
- hook 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' );