WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/08/2016 07:31:37 PM (5 years ago)
Author:
westonruter
Message:

Customize: Use selected user language for edit shortcuts in preview instead of site language.

Props ocean90.
Fixes #39009.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r38810 r39545  
    11241124        global $wp_registered_sidebars, $wp_registered_widgets;
    11251125
     1126        $switched_locale = switch_to_locale( get_user_locale() );
     1127        $l10n = array(
     1128            'widgetTooltip'  => __( 'Shift-click to edit this widget.' ),
     1129        );
     1130        if ( $switched_locale ) {
     1131            restore_previous_locale();
     1132        }
     1133
    11261134        // Prepare Customizer settings to pass to JavaScript.
    11271135        $settings = array(
     
    11301138            'registeredSidebars' => array_values( $wp_registered_sidebars ),
    11311139            'registeredWidgets'  => $wp_registered_widgets,
    1132             'l10n'               => array(
    1133                 'widgetTooltip'  => __( 'Shift-click to edit this widget.' ),
    1134             ),
     1140            'l10n'               => $l10n,
    11351141            'selectiveRefreshableWidgets' => $this->get_selective_refreshable_widgets(),
    11361142        );
Note: See TracChangeset for help on using the changeset viewer.