Add get_language_attributes(), which is then used by (...drum roll...) language_attributes().

Props johnbillion, posykrat, PeterRKnight.
Fixes #28180.


git-svn-id: https://develop.svn.wordpress.org/trunk@32868 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-06-19 21:35:22 +00:00
parent ee4e5c4b35
commit a484b6a634

View File

@ -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 );
}
/**