Make WordPress Core


Ignore:
Timestamp:
12/12/2016 01:58:21 AM (10 years ago)
Author:
dd32
Message:

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

Props ocean90.
Merges [39545] to the 4.7 branch.
Fixes #39009.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/class-wp-customize-manager.php

    r39507 r39571  
    17771777                        $allowed_hosts[] = $host;
    17781778                }
     1779
     1780                $switched_locale = switch_to_locale( get_user_locale() );
     1781                $l10n = array(
     1782                        'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
     1783                        'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
     1784                        'formUnpreviewable' => __( 'This form is not live-previewable.' ),
     1785                );
     1786                if ( $switched_locale ) {
     1787                        restore_previous_locale();
     1788                }
     1789
    17791790                $settings = array(
    17801791                        'changeset' => array(
    … …  
    18011812                        'settingValidities' => $exported_setting_validities,
    18021813                        'nonce' => current_user_can( 'customize' ) ? $this->get_nonces() : array(),
    1803                         'l10n' => array(
    1804                                 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
    1805                                 'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
    1806                                 'formUnpreviewable' => __( 'This form is not live-previewable.' ),
    1807                         ),
     1814                        'l10n' => $l10n,
    18081815                        '_dirty' => array_keys( $post_values ),
    18091816                );
Note: See TracChangeset for help on using the changeset viewer.