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