Make WordPress Core

Changeset 53101


Ignore:
Timestamp:
04/07/2022 11:14:52 PM (2 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

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/authorize-application.php

    r51878 r53101  
    166166                <p>
    167167                    <?php
     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>.',
     178                            $blogs_count
     179                        );
     180                    }
    168181                    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>.',
    173                             $blogs_count
    174                         ),
     182                        $msg_fmt,
    175183                        admin_url( 'my-sites.php' ),
    176184                        number_format_i18n( $blogs_count )
  • 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.