language_attributes() WP 2.1.0
Выводит атрибуты для HTML тега <html> со значениями текущего языка: lang="ru-RU"
Строит набор атрибутов для HTML тега <html> HTML, содержащих название языка сайта и направление чтения для страницы.
Работает на основе: get_language_attributes()
1 раз = 0.000125с = быстро | 50000 раз = 2.85с = быстро
Хуков нет.
Возвращает
Ничего. Выводит строку на экран.
Использование
<html <?php language_attributes(); ?>>
- $doctype(строка)
- Тип html документа: xhtml или html.
По умолчанию: 'html'
Примеры
#1 Что выводит language_attributes()
Если у вас сайт на русском, то:
language_attributes(); // Выведет: lang="ru-RU"
#2 Как использовать в коде
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> ...
Список изменений
С версии 2.1.0 | Введена. |
С версии 4.3.0 | Converted into a wrapper for get_language_attributes(). |
Код language_attributes() language attributes WP 5.6
function language_attributes( $doctype = 'html' ) {
echo get_language_attributes( $doctype );
}Cвязанные функции
Из метки: localize (l10n i18n локализация Internationalization)
Еще из тегов шаблона: Основные
- bloginfo()
- calendar_week_mod()
- get_archives_link()
- get_bloginfo()
- get_calendar()
- get_current_blog_id()
- get_footer()
- get_header()
- get_search_form()
- get_sidebar()
- get_template_part()
- is_404()
- is_active_sidebar()
- is_admin()
- is_archive()
- is_attachment()
- is_author()
- is_category()
- is_comment_feed()
- is_date()
- is_day()
- is_dynamic_sidebar()
- is_embed()
- is_feed()
- is_front_page()
- is_home()
- is_month()
- is_page_template()
- is_paged()
- is_post_type_archive()
- is_preview()
- is_search()
- is_single()
- is_singular()
- is_ssl()
- is_sticky()
- is_tag()
- is_tax()
- is_year()
- post_type_archive_title()
- register_sidebar()
- setup_postdata()
- the_archive_description()
- the_archive_title()
- wp_enqueue_script()
- wp_enqueue_style()
- wp_footer()
- wp_get_archives()
- wp_get_document_title()
- wp_head()
- wp_login_form()
- wp_login_url()
- wp_loginout()
- wp_logout_url()
- wp_lostpassword_url()
- wp_register()
- wp_title()