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
This commit is contained in:
David Baumwald 2021-05-19 18:09:27 +00:00
parent 862452984e
commit 07ce792fd6
5 changed files with 7 additions and 7 deletions

View File

@ -242,7 +242,7 @@ do_action( 'customize_controls_head' );
</div> </div>
<div id="customize-footer-actions" class="wp-full-overlay-footer"> <div id="customize-footer-actions" class="wp-full-overlay-footer">
<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' ) ); ?>"> <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' ); ?>">
<span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-arrow"></span>
<span class="collapse-sidebar-label"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span> <span class="collapse-sidebar-label"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span>
</button> </button>

View File

@ -208,7 +208,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
return false; return false;
} }
echo '<h2 class="update-from-upload-heading">' . esc_html( __( 'This plugin is already installed.' ) ) . '</h2>'; echo '<h2 class="update-from-upload-heading">' . esc_html__( 'This plugin is already installed.' ) . '</h2>';
$this->is_downgrading = version_compare( $current_plugin_data['Version'], $new_plugin_data['Version'], '>' ); $this->is_downgrading = version_compare( $current_plugin_data['Version'], $new_plugin_data['Version'], '>' );
@ -256,7 +256,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
$install_actions = array(); $install_actions = array();
$can_update = true; $can_update = true;
$blocked_message = '<p>' . esc_html( __( 'The plugin cannot be updated due to the following:' ) ) . '</p>'; $blocked_message = '<p>' . esc_html__( 'The plugin cannot be updated due to the following:' ) . '</p>';
$blocked_message .= '<ul class="ul-disc">'; $blocked_message .= '<ul class="ul-disc">';
$requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null; $requires_php = isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : null;

View File

@ -221,7 +221,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
return false; return false;
} }
echo '<h2 class="update-from-upload-heading">' . esc_html( __( 'This theme is already installed.' ) ) . '</h2>'; echo '<h2 class="update-from-upload-heading">' . esc_html__( 'This theme is already installed.' ) . '</h2>';
// Check errors for current theme. // Check errors for current theme.
if ( is_wp_error( $current_theme_data->errors() ) ) { if ( is_wp_error( $current_theme_data->errors() ) ) {
@ -291,7 +291,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$install_actions = array(); $install_actions = array();
$can_update = true; $can_update = true;
$blocked_message = '<p>' . esc_html( __( 'The theme cannot be updated due to the following:' ) ) . '</p>'; $blocked_message = '<p>' . esc_html__( 'The theme cannot be updated due to the following:' ) . '</p>';
$blocked_message .= '<ul class="ul-disc">'; $blocked_message .= '<ul class="ul-disc">';
$requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null; $requires_php = isset( $new_theme_data['RequiresPHP'] ) ? $new_theme_data['RequiresPHP'] : null;

View File

@ -236,7 +236,7 @@ class WP_Application_Passwords_List_Table extends WP_List_Table {
case 'revoke': case 'revoke':
printf( printf(
'<input type="submit" class="button delete" value="%1$s" aria-label="%2$s">', '<input type="submit" class="button delete" value="%1$s" aria-label="%2$s">',
esc_attr( __( 'Revoke' ) ), esc_attr__( 'Revoke' ),
/* translators: %s: the application password's given name. */ /* translators: %s: the application password's given name. */
esc_attr( sprintf( __( 'Revoke "%s"' ), '{{ data.name }}' ) ) esc_attr( sprintf( __( 'Revoke "%s"' ), '{{ data.name }}' ) )
); );

View File

@ -663,7 +663,7 @@ get_current_screen()->set_help_sidebar(
require_once ABSPATH . 'wp-admin/admin-header.php'; require_once ABSPATH . 'wp-admin/admin-header.php';
?> ?>
<div class="wrap"> <div class="wrap">
<h1 class="wp-heading-inline"><?php echo esc_html( __( 'Menus' ) ); ?></h1> <h1 class="wp-heading-inline"><?php esc_html_e( 'Menus' ); ?></h1>
<?php <?php
if ( current_user_can( 'customize' ) ) : if ( current_user_can( 'customize' ) ) :
$focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' ); $focus = $locations_screen ? array( 'section' => 'menu_locations' ) : array( 'panel' => 'nav_menus' );