From 38037c8d62abbf40d8614779cc63c83891620da6 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 19 Jun 2015 21:36:28 +0000 Subject: [PATCH] Add `get_language_attributes()`, which is then used by (...drum roll...) `language_attributes()`. Props johnbillion, posykrat, PeterRKnight. Fixes #28180. Built from https://develop.svn.wordpress.org/trunk@32868 git-svn-id: http://core.svn.wordpress.org/trunk@32839 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 26 +++++++++++++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 1945c6738f..65585fbf9c 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -2527,16 +2527,16 @@ function the_search_query() { } /** - * Display the language attributes for the html tag. + * Get the language attributes for the html tag. * * Builds up a set of html attributes containing the text direction and language * information for the page. * - * @since 2.1.0 + * @since 4.3.0 * - * @param string $doctype The type of html document (xhtml|html). + * @param string $doctype Optional. The type of html document (xhtml|html). Default html. */ -function language_attributes($doctype = 'html') { +function get_language_attributes( $doctype = 'html' ) { $attributes = array(); if ( function_exists( 'is_rtl' ) && is_rtl() ) @@ -2556,10 +2556,26 @@ function language_attributes($doctype = 'html') { * Filter the language attributes for display in the html tag. * * @since 2.5.0 + * @since 4.3.0 Added the `$doctype` parameter. * * @param string $output A space-separated list of language attributes. + * @param string $doctype The type of html document (xhtml|html). */ - echo apply_filters( 'language_attributes', $output ); + return apply_filters( 'language_attributes', $output, $doctype ); +} + +/** + * Display the language attributes for the html tag. + * + * Builds up a set of html attributes containing the text direction and language + * information for the page. + * + * @since 2.1.0 + * + * @param string $doctype Optional. The type of html document (xhtml|html). Default html. + */ +function language_attributes( $doctype = 'html' ) { + echo get_language_attributes( $doctype ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index b69b8435b0..9a3d972d6c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32867'; +$wp_version = '4.3-alpha-32868'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.