Skip to content

Commit 794d76c

Browse files
committed
Application Passwords: Use a more appropriate helper text message for super-admins.
Previously, the helper text of the application password section was misleading for a Super Admin because an application password for a Super Admin grants access to all sites on the network, not just ones that they are a member of. This changeset provides a slightly different message for Super admin role. Props johnbillion, rsiddharth, audrasjb. Fixes #53234 git-svn-id: https://develop.svn.wordpress.org/trunk@53101 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a43a096 commit 794d76c

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

src/wp-admin/authorize-application.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,21 @@
165165
?>
166166
<p>
167167
<?php
168-
printf(
169-
/* translators: 1: URL to my-sites.php, 2: Number of sites the user has. */
170-
_n(
171-
'This will grant access to <a href="%1$s">the %2$s site in this installation that you have permissions on</a>.',
172-
'This will grant access to <a href="%1$s">all %2$s sites in this installation that you have permissions on</a>.',
168+
/* translators: 1: URL to my-sites.php, 2: Number of sites the user has. */
169+
$msg_fmt = _n(
170+
'This will grant access to <a href="%1$s">the %2$s site in this installation that you have permissions on</a>.',
171+
'This will grant access to <a href="%1$s">all %2$s sites in this installation that you have permissions on</a>.',
172+
$blogs_count
173+
);
174+
if ( is_super_admin() ) {
175+
$msg_fmt = _n(
176+
'This will grant access to <a href="%1$s">the %2$s site on the network as you have Super Admin rights</a>.',
177+
'This will grant access to <a href="%1$s">all %2$s sites on the network as you have Super Admin rights</a>.',
173178
$blogs_count
174-
),
179+
);
180+
}
181+
printf(
182+
$msg_fmt,
175183
admin_url( 'my-sites.php' ),
176184
number_format_i18n( $blogs_count )
177185
);

src/wp-admin/user-edit.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -746,13 +746,21 @@
746746
?>
747747
<p>
748748
<?php
749-
printf(
750-
/* translators: 1: URL to my-sites.php, 2: Number of sites the user has. */
751-
_n(
752-
'Application passwords grant access to <a href="%1$s">the %2$s site in this installation that you have permissions on</a>.',
753-
'Application passwords grant access to <a href="%1$s">all %2$s sites in this installation that you have permissions on</a>.',
749+
/* translators: 1: URL to my-sites.php, 2: Number of sites the user has. */
750+
$msg_fmt = _n(
751+
'Application passwords grant access to <a href="%1$s">the %2$s site in this installation that you have permissions on</a>.',
752+
'Application passwords grant access to <a href="%1$s">all %2$s sites in this installation that you have permissions on</a>.',
753+
$blogs_count
754+
);
755+
if ( is_super_admin( $user_id ) ) {
756+
$msg_fmt = _n(
757+
'Application passwords grant access to <a href="%1$s">the %2$s site on the network as you have Super Admin rights</a>.',
758+
'Application passwords grant access to <a href="%1$s">all %2$s sites on the network as you have Super Admin rights</a>.',
754759
$blogs_count
755-
),
760+
);
761+
}
762+
printf(
763+
$msg_fmt,
756764
admin_url( 'my-sites.php' ),
757765
number_format_i18n( $blogs_count )
758766
);

0 commit comments

Comments
 (0)