Make WordPress Core

Changeset 49282


Ignore:
Timestamp:
10/23/2020 01:17:22 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Update some alignment in wp-admin/authorize-application.php for consistency.

Save blogs count to a variable for reusing.

Follow-up to [49270].

See #51489.

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

Legend:

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

    r49276 r49282  
    129129        <?php if ( $app_name ) : ?>
    130130            <p>
    131             <?php
    132             /* translators: %s: Application name. */
    133             printf( __( 'Would you like to give the application identifying itself as %s access to your account? You should only do this if you trust the app in question.' ), '<strong>' . esc_html( $app_name ) . '</strong>' );
    134             ?>
     131                <?php
     132                printf(
     133                    /* translators: %s: Application name. */
     134                    __( 'Would you like to give the application identifying itself as %s access to your account? You should only do this if you trust the app in question.' ),
     135                    '<strong>' . esc_html( $app_name ) . '</strong>'
     136                );
     137                ?>
    135138            </p>
    136139        <?php else : ?>
     
    140143        <?php
    141144        if ( is_multisite() ) {
    142             $blogs = get_blogs_of_user( $user->ID, true );
    143             if ( count( $blogs ) > 1 ) {
     145            $blogs       = get_blogs_of_user( $user->ID, true );
     146            $blogs_count = count( $blogs );
     147            if ( $blogs_count > 1 ) {
    144148                ?>
    145149                <p>
    146                 <?php
     150                    <?php
    147151                    printf(
    148                         /* translators: 1: url to my-sites.php, 2: Number of blogs the user has. */
     152                        /* translators: 1: URL to my-sites.php, 2: Number of blogs the user has. */
    149153                        _n(
    150154                            'This will grant access to <a href="%1$s">the %2$s blog in this installation that you have permissions on</a>.',
    151155                            'This will grant access to <a href="%1$s">all %2$s blogs in this installation that you have permissions on</a>.',
    152                             count( $blogs )
     156                            $blogs_count
    153157                        ),
    154158                        admin_url( 'my-sites.php' ),
    155                         number_format_i18n( count( $blogs ) )
     159                        number_format_i18n( $blogs_count )
    156160                    );
    157                 ?>
     161                    ?>
    158162                </p>
    159163                <?php
  • trunk/src/wp-admin/user-edit.php

    r49270 r49282  
    718718            <?php
    719719            if ( is_multisite() ) {
    720                 $blogs = get_blogs_of_user( $user_id, true );
    721                 if ( count( $blogs ) > 1 ) {
     720                $blogs       = get_blogs_of_user( $user_id, true );
     721                $blogs_count = count( $blogs );
     722                if ( $blogs_count > 1 ) {
    722723                    ?>
    723724                    <p>
    724                     <?php
    725                     printf(
    726                         /* translators: 1: url to my-sites.php, 2: Number of blogs the user has. */
    727                         _n(
    728                             'Application passwords grant access to <a href="%1$s">the %2$s blog in this installation that you have permissions on</a>.',
    729                             'Application passwords grant access to <a href="%1$s">all %2$s blogs in this installation that you have permissions on</a>.',
    730                             count( $blogs )
    731                         ),
    732                         admin_url( 'my-sites.php' ),
    733                         number_format_i18n( count( $blogs ) )
    734                     );
    735                     ?>
     725                        <?php
     726                        printf(
     727                            /* translators: 1: URL to my-sites.php, 2: Number of blogs the user has. */
     728                            _n(
     729                                'Application passwords grant access to <a href="%1$s">the %2$s blog in this installation that you have permissions on</a>.',
     730                                'Application passwords grant access to <a href="%1$s">all %2$s blogs in this installation that you have permissions on</a>.',
     731                                $blogs_count
     732                            ),
     733                            admin_url( 'my-sites.php' ),
     734                            number_format_i18n( $blogs_count )
     735                        );
     736                        ?>
    736737                    </p>
    737738                    <?php
Note: See TracChangeset for help on using the changeset viewer.