Make WordPress Core


Ignore:
Timestamp:
04/07/2022 11:14:52 PM (3 years ago)
Author:
audrasjb
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r52820 r53101  
    747747                                        <p>
    748748                                            <?php
     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>.',
     759                                                    $blogs_count
     760                                                );
     761                                            }
    749762                                            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>.',
    754                                                     $blogs_count
    755                                                 ),
     763                                                $msg_fmt,
    756764                                                admin_url( 'my-sites.php' ),
    757765                                                number_format_i18n( $blogs_count )
Note: See TracChangeset for help on using the changeset viewer.