diff --git a/src/wp-admin/admin-header.php b/src/wp-admin/admin-header.php
index ed9c0399f9..cbce31b59f 100644
--- a/src/wp-admin/admin-header.php
+++ b/src/wp-admin/admin-header.php
@@ -35,18 +35,18 @@ get_admin_page_title();
$title = esc_html( strip_tags( $title ) );
if ( is_network_admin() ) {
- /* translators: Network admin screen title. 1: Network name */
+ /* translators: Network admin screen title. %s: Network name */
$admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) );
} elseif ( is_user_admin() ) {
- /* translators: User dashboard screen title. 1: Network name */
+ /* translators: User dashboard screen title. %s: Network name */
$admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) );
} else {
$admin_title = get_bloginfo( 'name' );
}
if ( $admin_title == $title ) {
- /* translators: Admin screen title. 1: Admin screen name */
- $admin_title = sprintf( __( '%1$s — WordPress' ), $title );
+ /* translators: Admin screen title. %s: Admin screen name */
+ $admin_title = sprintf( __( '%s — WordPress' ), $title );
} else {
/* translators: Admin screen title. 1: Admin screen name, 2: Network or site name */
$admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title );
diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php
index 6e91e1754a..6b82c15fe5 100644
--- a/src/wp-admin/edit-comments.php
+++ b/src/wp-admin/edit-comments.php
@@ -146,7 +146,7 @@ if ( $post_id ) {
$comments_count = wp_count_comments( $post_id );
$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
if ( $comments_count->moderated > 0 ) {
- /* translators: 1: comments count 2: post title */
+ /* translators: 1: comments count, 2: post title */
$title = sprintf(
__( 'Comments (%1$s) on “%2$s”' ),
number_format_i18n( $comments_count->moderated ),
diff --git a/src/wp-admin/includes/class-bulk-upgrader-skin.php b/src/wp-admin/includes/class-bulk-upgrader-skin.php
index 2b2ebd00d5..c1454e62f1 100644
--- a/src/wp-admin/includes/class-bulk-upgrader-skin.php
+++ b/src/wp-admin/includes/class-bulk-upgrader-skin.php
@@ -41,10 +41,10 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
$this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' );
/* translators: 1: Title of an update, 2: Error message */
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while updating %1$s: %2$s' );
- /* translators: 1: Title of an update */
- $this->upgrader->strings['skin_update_failed'] = __( 'The update of %1$s failed.' );
- /* translators: 1: Title of an update */
- $this->upgrader->strings['skin_update_successful'] = __( '%1$s updated successfully.' );
+ /* translators: %s: Title of an update */
+ $this->upgrader->strings['skin_update_failed'] = __( 'The update of %s failed.' );
+ /* translators: %s: Title of an update */
+ $this->upgrader->strings['skin_update_successful'] = __( '%s updated successfully.' );
$this->upgrader->strings['skin_upgrade_end'] = __( 'All updates have been completed.' );
}
diff --git a/src/wp-admin/includes/class-language-pack-upgrader.php b/src/wp-admin/includes/class-language-pack-upgrader.php
index a750d8aa3c..118d339d02 100644
--- a/src/wp-admin/includes/class-language-pack-upgrader.php
+++ b/src/wp-admin/includes/class-language-pack-upgrader.php
@@ -337,7 +337,7 @@ class Language_Pack_Upgrader extends WP_Upgrader {
if ( ! $mo || ! $po ) {
return new WP_Error(
'incompatible_archive_pomo', $this->strings['incompatible_archive'],
- /* translators: 1: .po 2: .mo */
+ /* translators: 1: .po, 2: .mo */
sprintf(
__( 'The language pack is missing either the %1$s or %2$s files.' ),
'.po',
diff --git a/src/wp-admin/includes/class-wp-plugin-install-list-table.php b/src/wp-admin/includes/class-wp-plugin-install-list-table.php
index f82180109e..ceb0558c05 100644
--- a/src/wp-admin/includes/class-wp-plugin-install-list-table.php
+++ b/src/wp-admin/includes/class-wp-plugin-install-list-table.php
@@ -504,25 +504,43 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
switch ( $status['status'] ) {
case 'install':
if ( $status['url'] ) {
- /* translators: 1: Plugin name and version. */
- $action_links[] = '' . __( 'Install Now' ) . '';
+ $action_links[] = sprintf(
+ '%s',
+ esc_attr( $plugin['slug'] ),
+ esc_url( $status['url'] ),
+ /* translators: %s: plugin name and version */
+ esc_attr( sprintf( __( 'Install %s now' ), $name ) ),
+ esc_attr( $name ),
+ __( 'Install Now' )
+ );
}
break;
case 'update_available':
if ( $status['url'] ) {
- /* translators: 1: Plugin name and version */
- $action_links[] = '' . __( 'Update Now' ) . '';
+ $action_links[] = sprintf(
+ '%s',
+ esc_attr( $status['file'] ),
+ esc_attr( $plugin['slug'] ),
+ esc_url( $status['url'] ),
+ /* translators: %s: plugin name and version */
+ esc_attr( sprintf( __( 'Update %s now' ), $name ) ),
+ esc_attr( $name ),
+ __( 'Update Now' )
+ );
}
break;
case 'latest_installed':
case 'newer_installed':
if ( is_plugin_active( $status['file'] ) ) {
- $action_links[] = '';
+ $action_links[] = sprintf(
+ '',
+ _x( 'Active', 'plugin' )
+ );
} elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) {
$button_text = __( 'Activate' );
- /* translators: %s: Plugin name */
+ /* translators: %s: plugin name */
$button_label = _x( 'Activate %s', 'plugin' );
$activate_url = add_query_arg(
array(
@@ -534,7 +552,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
if ( is_network_admin() ) {
$button_text = __( 'Network Activate' );
- /* translators: %s: Plugin name */
+ /* translators: %s: plugin name */
$button_label = _x( 'Network Activate %s', 'plugin' );
$activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url );
}
@@ -546,7 +564,10 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$button_text
);
} else {
- $action_links[] = '';
+ $action_links[] = sprintf(
+ '',
+ _x( 'Installed', 'plugin' )
+ );
}
break;
}
@@ -557,8 +578,14 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
'&TB_iframe=true&width=600&height=550'
);
- /* translators: 1: Plugin name and version. */
- $action_links[] = '' . __( 'More Details' ) . '';
+ $action_links[] = sprintf(
+ '%s',
+ esc_url( $details_link ),
+ /* translators: %s: plugin name and version */
+ esc_attr( sprintf( __( 'More information about %s' ), $name ) ),
+ esc_attr( $name ),
+ __( 'More Details' )
+ );
if ( ! empty( $plugin['icons']['svg'] ) ) {
$plugin_icon_url = $plugin['icons']['svg'];
diff --git a/src/wp-admin/includes/class-wp-theme-install-list-table.php b/src/wp-admin/includes/class-wp-theme-install-list-table.php
index 6d107d8d8a..a1ac60b628 100644
--- a/src/wp-admin/includes/class-wp-theme-install-list-table.php
+++ b/src/wp-admin/includes/class-wp-theme-install-list-table.php
@@ -264,6 +264,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
$name = wp_kses( $theme->name, $themes_allowedtags );
$author = wp_kses( $theme->author, $themes_allowedtags );
+ /* translators: %s: theme name */
$preview_title = sprintf( __( 'Preview “%s”' ), $name );
$preview_url = add_query_arg(
array(
@@ -292,19 +293,41 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
switch ( $status ) {
case 'update_available':
- $actions[] = '' . __( 'Update' ) . '';
+ $actions[] = sprintf(
+ '%s',
+ esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
+ /* translators: %s: theme version */
+ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
+ __( 'Update' )
+ );
break;
case 'newer_installed':
case 'latest_installed':
- $actions[] = '' . _x( 'Installed', 'theme' ) . '';
+ $actions[] = sprintf(
+ '%s',
+ esc_attr__( 'This theme is already installed and is up to date' ),
+ _x( 'Installed', 'theme' )
+ );
break;
case 'install':
default:
- $actions[] = '' . __( 'Install Now' ) . '';
+ $actions[] = sprintf(
+ '%s',
+ esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
+ /* translators: %s: theme name */
+ esc_attr( sprintf( __( 'Install %s' ), $name ) ),
+ __( 'Install Now' )
+ );
break;
}
- $actions[] = '' . __( 'Preview' ) . '';
+ $actions[] = sprintf(
+ '%s',
+ esc_url( $preview_url ),
+ /* translators: %s: theme name */
+ esc_attr( sprintf( __( 'Preview %s' ), $name ) ),
+ __( 'Preview' )
+ );
/**
* Filters the install action links for a theme in the Install Themes list table.
@@ -323,7 +346,10 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
' . substr( $hostname, 4 ) . '',
'' . $hostname . '',
@@ -296,7 +296,7 @@ function network_step1( $errors = false ) {
localhost.localdomain'
@@ -436,7 +436,7 @@ function network_step2( $errors = false ) {
if ( file_exists( $home_path . '.htaccess' ) ) {
echo '' . __( 'Caution:' ) . ' ';
printf(
- /* translators: 1: wp-config.php 2: .htaccess */
+ /* translators: 1: wp-config.php, 2: .htaccess */
__( 'We recommend you back up your existing %1$s and %2$s files.' ),
'wp-config.php',
'.htaccess'
@@ -444,7 +444,7 @@ function network_step2( $errors = false ) {
} elseif ( file_exists( $home_path . 'web.config' ) ) {
echo '' . __( 'Caution:' ) . ' ';
printf(
- /* translators: 1: wp-config.php 2: web.config */
+ /* translators: 1: wp-config.php, 2: web.config */
__( 'We recommend you back up your existing %1$s and %2$s files.' ),
'wp-config.php',
'web.config'
@@ -452,7 +452,7 @@ function network_step2( $errors = false ) {
} else {
echo '' . __( 'Caution:' ) . ' ';
printf(
- /* translators: 1: wp-config.php */
+ /* translators: %s: wp-config.php */
__( 'We recommend you back up your existing %s file.' ),
'wp-config.php'
);
@@ -466,7 +466,7 @@ function network_step2( $errors = false ) {
above the line reading %3$s:' ),
'wp-config.php',
'' . $location_of_wp_config . '',
@@ -523,13 +523,13 @@ if ( ! empty( $keys_salts ) ) {
wp-config.php'
);
} else {
printf(
- /* translators: 1: wp-config.php */
+ /* translators: %s: wp-config.php */
__( 'These unique authentication keys are also missing from your %s file.' ),
'wp-config.php'
);
@@ -598,7 +598,7 @@ if ( iis7_supports_permalinks() ) :
echo '
';
printf(
- /* translators: 1: a filename like .htaccess. 2: a file path. */
+ /* translators: 1: a filename like .htaccess, 2: a file path */
__( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ),
'web.config',
'' . $home_path . ''
@@ -640,7 +640,7 @@ EOF;
echo '
';
printf(
- /* translators: 1: a filename like .htaccess. 2: a file path. */
+ /* translators: 1: a filename like .htaccess, 2: a file path */
__( 'Add the following to your %1$s file in %2$s, replacing other WordPress rules:' ),
'.htaccess',
'' . $home_path . ''
diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
index 21002ba1f9..66fb943b85 100644
--- a/src/wp-admin/includes/template.php
+++ b/src/wp-admin/includes/template.php
@@ -2202,7 +2202,7 @@ function convert_to_screen( $hook_name ) {
_doing_it_wrong(
'convert_to_screen(), add_meta_box()',
sprintf(
- /* translators: 1: wp-admin/includes/template.php 2: add_meta_box() 3: add_meta_boxes */
+ /* translators: 1: wp-admin/includes/template.php, 2: add_meta_box(), 3: add_meta_boxes */
__( 'Likely direct inclusion of %1$s in order to use %2$s. This is very wrong. Hook the %2$s call into the %3$s action instead.' ),
'wp-admin/includes/template.php',
'add_meta_box()',
@@ -2285,11 +2285,11 @@ function wp_star_rating( $args = array() ) {
$empty_stars = 5 - $full_stars - $half_stars;
if ( $r['number'] ) {
- /* translators: 1: The rating, 2: The number of ratings */
+ /* translators: 1: the rating, 2: the number of ratings */
$format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number'] );
$title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $r['number'] ) );
} else {
- /* translators: 1: The rating */
+ /* translators: %s: the rating */
$title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
}
diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php
index 34554f6187..4a22e9541f 100644
--- a/src/wp-admin/includes/user.php
+++ b/src/wp-admin/includes/user.php
@@ -556,7 +556,7 @@ function use_ssl_preference( $user ) {
function admin_created_user_email( $text ) {
$roles = get_editable_roles();
$role = $roles[ $_REQUEST['role'] ];
- /* translators: 1: Site name, 2: site URL, 3: role */
+ /* translators: 1: site name, 2: site URL, 3: role */
return sprintf(
__(
'Hi,
diff --git a/src/wp-admin/maint/repair.php b/src/wp-admin/maint/repair.php
index 01bda0e41f..30c40c8a0e 100644
--- a/src/wp-admin/maint/repair.php
+++ b/src/wp-admin/maint/repair.php
@@ -65,7 +65,7 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
echo '
' . sprintf( __( 'While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the WordPress.org secret key service.' ), 'wp-config.php', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '
NOBLOGREDIRECT',
diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php
index 271f13de8f..94b4328b41 100644
--- a/src/wp-admin/plugins.php
+++ b/src/wp-admin/plugins.php
@@ -463,7 +463,7 @@ if ( ! empty( $invalid ) ) {
foreach ( $invalid as $plugin_file => $error ) {
echo '';
printf(
- /* translators: 1: plugin file 2: error message */
+ /* translators: 1: plugin file, 2: error message */
__( 'The plugin %1$s has been deactivated due to an error: %2$s' ),
'' . esc_html( $plugin_file ) . '',
$error->get_error_message()
diff --git a/src/wp-admin/revision.php b/src/wp-admin/revision.php
index e6ae445293..b2d9a009e6 100644
--- a/src/wp-admin/revision.php
+++ b/src/wp-admin/revision.php
@@ -88,8 +88,8 @@ switch ( $action ) {
$post_edit_link = get_edit_post_link();
$post_title = '' . _draft_or_post_title() . '';
- /* translators: 1: Post title */
- $h1 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title );
+ /* translators: %s: post title */
+ $h1 = sprintf( __( 'Compare Revisions of “%s”' ), $post_title );
$return_to_post = '' . __( '← Return to editor' ) . '';
$title = __( 'Revisions' );
diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php
index ce844e93e5..f09ecdf6f1 100644
--- a/src/wp-admin/setup-config.php
+++ b/src/wp-admin/setup-config.php
@@ -59,7 +59,7 @@ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) {
if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
wp_die(
'
' . sprintf(
- /* translators: 1: wp-config.php 2: install.php */
+ /* translators: 1: wp-config.php, 2: install.php */
__( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.' ),
'wp-config.php',
'install.php'
@@ -71,7 +71,7 @@ if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {
wp_die(
'
' . sprintf(
- /* translators: 1: wp-config.php 2: install.php */
+ /* translators: 1: wp-config.php, 2: install.php */
__( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.' ),
'wp-config.php',
'install.php'
diff --git a/src/wp-admin/user-edit.php b/src/wp-admin/user-edit.php
index 955a82a998..8a301df12c 100644
--- a/src/wp-admin/user-edit.php
+++ b/src/wp-admin/user-edit.php
@@ -675,7 +675,7 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) :
display_name ); ?>
diff --git a/src/wp-includes/class-wp-customize-nav-menus.php b/src/wp-includes/class-wp-customize-nav-menus.php index 9ffe0867b1..48be42e162 100644 --- a/src/wp-includes/class-wp-customize-nav-menus.php +++ b/src/wp-includes/class-wp-customize-nav-menus.php @@ -947,7 +947,7 @@ final class WP_Customize_Nav_Menus { } $data = array( - /* translators: %1$s is the post type name and %2$s is the error message. */ + /* translators: 1: post type name, 2: error message */ 'message' => sprintf( __( '%1$s could not be created: %2$s' ), $singular_name, $error->get_error_message() ), ); wp_send_json_error( $data ); @@ -981,7 +981,7 @@ final class WP_Customize_Nav_Menus {