Skip to content

Commit 07ce792

Browse files
committed
I18N: Combine escaping and translation functions.
There are a few instances where two separate functions are used for both escaping and translating output. This change combines the two functions into the appropriate Core helper function. Props dimadin, SergeyBiryukov. Fixes #53153. git-svn-id: https://develop.svn.wordpress.org/trunk@50931 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 8624529 commit 07ce792

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/wp-admin/customize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
</div>
243243

244244
<div id="customize-footer-actions" class="wp-full-overlay-footer">
245-
<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php echo esc_attr( _x( 'Hide Controls', 'label for hide controls button without length constraints' ) ); ?>">
245+
<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php echo esc_attr_x( 'Hide Controls', 'label for hide controls button without length constraints' ); ?>">
246246
<span class="collapse-sidebar-arrow"></span>
247247
<span class="collapse-sidebar-label"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span>
248248
</button>

src/wp-admin/includes/class-plugin-installer-skin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ private function do_overwrite() {
208208
return false;
209209
}
210210

211-
echo '<h2 class="update-from-upload-heading">' . esc_html( __( 'This plugin is already installed.' ) ) . '</h2>';
211+
echo '<h2 class="update-from-upload-heading">' . esc_html__( 'This plugin is already installed.' ) . '</h2>';
212212

213213
$this->is_downgrading = version_compare( $current_plugin_data['Version'], $new_plugin_data['Version'], '>' );
214214

@@ -256,7 +256,7 @@ private function do_overwrite() {
256256
$install_actions = array();
257257
$can_update = true;
258258

259-
$blocked_message = '<p>' . esc_html( __( 'The plugin cannot be updated due to the following:' ) ) . '</p>';
259+
$blocked_message = '<p>' . esc_html__( 'The plugin cannot be updated due to the following:' ) . '</p>';
260260
$blocked_message .= '<ul class="ul-disc">';
261261

262262
$requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null;

src/wp-admin/includes/class-theme-installer-skin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private function do_overwrite() {
221221
return false;
222222
}
223223

224-
echo '<h2 class="update-from-upload-heading">' . esc_html( __( 'This theme is already installed.' ) ) . '</h2>';
224+
echo '<h2 class="update-from-upload-heading">' . esc_html__( 'This theme is already installed.' ) . '</h2>';
225225

226226
// Check errors for current theme.
227227
if ( is_wp_error( $current_theme_data->errors() ) ) {
@@ -291,7 +291,7 @@ private function do_overwrite() {
291291
$install_actions = array();
292292
$can_update = true;
293293

294-
$blocked_message = '<p>' . esc_html( __( 'The theme cannot be updated due to the following:' ) ) . '</p>';
294+
$blocked_message = '<p>' . esc_html__( 'The theme cannot be updated due to the following:' ) . '</p>';
295295
$blocked_message .= '<ul class="ul-disc">';
296296

297297
$requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null;

src/wp-admin/includes/class-wp-application-passwords-list-table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function print_js_template_row() {
236236
case 'revoke':
237237
printf(
238238
'<input type="submit" class="button delete" value="%1$s" aria-label="%2$s">',
239-
esc_attr( __( 'Revoke' ) ),
239+
esc_attr__( 'Revoke' ),
240240
/* translators: %s: the application password's given name. */
241241
esc_attr( sprintf( __( 'Revoke "%s"' ), '{{ data.name }}' ) )
242242
);

src/wp-admin/nav-menus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ function wp_nav_menu_max_depth( $classes ) {
663663
require_once ABSPATH . 'wp-admin/admin-header.php';
664664
?>
665665
<div class="wrap">
666-
<h1 class="wp-heading-inline"><?php echo esc_html( __( 'Menus' ) ); ?></h1>
666+
<h1 class="wp-heading-inline"><?php esc_html_e( 'Menus' ); ?></h1>
667667
<?php
668668
if ( current_user_can( 'customize' ) ) :
669669
$focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' );

0 commit comments

Comments
 (0)