Make WordPress Core

Changeset 32868


Ignore:
Timestamp:
06/19/2015 09:35:22 PM (10 years ago)
Author:
wonderboymusic
Message:

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

Props johnbillion, posykrat, PeterRKnight.
Fixes #28180.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r32733 r32868  
    25282528
    25292529/**
    2530  * Display the language attributes for the html tag.
     2530 * Get the language attributes for the html tag.
    25312531 *
    25322532 * Builds up a set of html attributes containing the text direction and language
    25332533 * information for the page.
    25342534 *
    2535  * @since 2.1.0
    2536  *
    2537  * @param string $doctype The type of html document (xhtml|html).
    2538  */
    2539 function language_attributes($doctype = 'html') {
     2535 * @since 4.3.0
     2536 *
     2537 * @param string $doctype Optional. The type of html document (xhtml|html). Default html.
     2538 */
     2539function get_language_attributes( $doctype = 'html' ) {
    25402540    $attributes = array();
    25412541
     
    25572557     *
    25582558     * @since 2.5.0
     2559     * @since 4.3.0 Added the `$doctype` parameter.
    25592560     *
    25602561     * @param string $output A space-separated list of language attributes.
    2561      */
    2562     echo apply_filters( 'language_attributes', $output );
     2562     * @param string $doctype The type of html document (xhtml|html).
     2563     */
     2564    return apply_filters( 'language_attributes', $output, $doctype );
     2565}
     2566
     2567/**
     2568 * Display the language attributes for the html tag.
     2569 *
     2570 * Builds up a set of html attributes containing the text direction and language
     2571 * information for the page.
     2572 *
     2573 * @since 2.1.0
     2574 *
     2575 * @param string $doctype Optional. The type of html document (xhtml|html). Default html.
     2576 */
     2577function language_attributes( $doctype = 'html' ) {
     2578    echo get_language_attributes( $doctype );
    25632579}
    25642580
Note: See TracChangeset for help on using the changeset viewer.