From a1403240bba2fb2efccc2bce70cad01fe1d5b6c2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 23 Oct 2020 01:17:22 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@49282 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/authorize-application.php | 26 +++++++++++++---------- src/wp-admin/user-edit.php | 29 +++++++++++++------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/src/wp-admin/authorize-application.php b/src/wp-admin/authorize-application.php index b9cc0c0aac..524dbedf32 100644 --- a/src/wp-admin/authorize-application.php +++ b/src/wp-admin/authorize-application.php @@ -128,10 +128,13 @@ require_once ABSPATH . 'wp-admin/admin-header.php';

- ' . esc_html( $app_name ) . '' ); - ?> + ' . esc_html( $app_name ) . '' + ); + ?>

@@ -139,22 +142,23 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; ID, true ); - if ( count( $blogs ) > 1 ) { + $blogs = get_blogs_of_user( $user->ID, true ); + $blogs_count = count( $blogs ); + if ( $blogs_count > 1 ) { ?>

- the %2$s blog in this installation that you have permissions on.', 'This will grant access to all %2$s blogs in this installation that you have permissions on.', - count( $blogs ) + $blogs_count ), admin_url( 'my-sites.php' ), - number_format_i18n( count( $blogs ) ) + number_format_i18n( $blogs_count ) ); - ?> + ?>

1 ) { + $blogs = get_blogs_of_user( $user_id, true ); + $blogs_count = count( $blogs ); + if ( $blogs_count > 1 ) { ?>

- the %2$s blog in this installation that you have permissions on.', - 'Application passwords grant access to all %2$s blogs in this installation that you have permissions on.', - count( $blogs ) - ), - admin_url( 'my-sites.php' ), - number_format_i18n( count( $blogs ) ) - ); - ?> + the %2$s blog in this installation that you have permissions on.', + 'Application passwords grant access to all %2$s blogs in this installation that you have permissions on.', + $blogs_count + ), + admin_url( 'my-sites.php' ), + number_format_i18n( $blogs_count ) + ); + ?>