Make WordPress Core

Changeset 48607


Ignore:
Timestamp:
07/25/2020 03:24:21 PM (4 years ago)
Author:
SergeyBiryukov
Message:

I18N: Respect the passed text_direction argument in wp_die().

Previously, the passed value was only used as a fallback if get_language_attributes() is not yet available.

Props apedog.
Fixes #49060.

File:
1 edited

Legend:

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

    r48606 r48607  
    32873287 * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added.
    32883288 * @since 5.3.0 The `$charset` argument was added.
     3289 * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes()
     3290 *              in the default handler.
    32893291 *
    32903292 * @global WP_Query $wp_query WordPress Query object.
     
    33073309 *                                  Default empty string.
    33083310 *     @type bool   $back_link      Whether to include a link to go back. Default false.
    3309  *     @type string $text_direction The text direction. This is only useful internally, when WordPress
    3310  *                                  is still loading and the site's locale is not set up yet. Accepts 'rtl'.
     3311 *     @type string $text_direction The text direction. This is only useful internally, when WordPress is still
     3312 *                                  loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
    33113313 *                                  Default is the value of is_rtl().
    33123314 *     @type string $charset        Character set of the HTML output. Default 'utf-8'.
     
    34443446
    34453447        $text_direction = $parsed_args['text_direction'];
    3446         if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
     3448        $dir_attr       = "dir='$text_direction'";
     3449
     3450        // If `text_direction` was not explicitly passed,
     3451        // use get_language_attributes() if available.
     3452        if ( empty( $args['text_direction'] )
     3453            && function_exists( 'language_attributes' ) && function_exists( 'is_rtl' )
     3454        ) {
    34473455            $dir_attr = get_language_attributes();
    3448         } else {
    3449             $dir_attr = "dir='$text_direction'";
    34503456        }
    34513457        ?>
Note: See TracChangeset for help on using the changeset viewer.