From 8244397ffbf19e497cbc0f7a37e946373b450000 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 15 Aug 2018 06:22:26 +0000 Subject: [PATCH] Coding Standards: Prepare for upgrading WPCS to 1.0.0. In order to get the best result when running `phpcbf` across the codebase, there are some manual tweaks we need to make. These fall into three categories: - Fixing incorrectly indented code which has flow-on effects when auto-fixing. - Tweaking the layout of inline PHP inside HTML tags. - Moving more complex inline PHP inside HTML tags, to execute earlier. See #44600. Built from https://develop.svn.wordpress.org/trunk@43569 git-svn-id: http://core.svn.wordpress.org/trunk@43398 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-activate.php | 86 ++++++++++++++-------------- wp-admin/freedoms.php | 12 +++- wp-admin/includes/file.php | 26 ++++----- wp-admin/includes/meta-boxes.php | 28 +++++---- wp-admin/includes/nav-menu.php | 36 ++---------- wp-admin/includes/plugin-install.php | 28 ++++----- wp-admin/includes/template.php | 32 ++++++----- wp-admin/nav-menus.php | 47 +++++++-------- wp-admin/network/site-info.php | 7 +-- wp-admin/theme-editor.php | 4 +- wp-admin/update-core.php | 78 ++++++++++++------------- wp-includes/version.php | 2 +- wp-login.php | 6 +- xmlrpc.php | 4 +- 14 files changed, 187 insertions(+), 209 deletions(-) diff --git a/wp-activate.php b/wp-activate.php index dc3a0d42f5..ecdfddd09b 100644 --- a/wp-activate.php +++ b/wp-activate.php @@ -76,7 +76,9 @@ get_header( 'wp-activate' );
- +

@@ -89,49 +91,49 @@ get_header( 'wp-activate' );

- get_error_code() || 'blog_taken' == $result->get_error_code() ) { - $signup = $result->get_error_data(); - ?> -

- '; - if ( $signup->domain . $signup->path == '' ) { - printf( - /* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */ - __( 'Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), - network_site_url( 'wp-login.php', 'login' ), - $signup->user_login, - $signup->user_email, - wp_lostpassword_url() - ); - } else { - printf( - /* translators: 1: site URL, 2: username, 3: user email, 4: lost password URL */ - __( 'Your site at %1$s is active. You may now log in to your site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), - sprintf( '%1$s', $signup->domain ), - $signup->user_login, - $signup->user_email, - wp_lostpassword_url() - ); - } - echo '

'; - } else { - ?> -

+ $key = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key']; + $result = wpmu_activate_signup( $key ); + if ( is_wp_error( $result ) ) { + if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) { + $signup = $result->get_error_data(); + ?> +

+ '; + if ( $signup->domain . $signup->path == '' ) { + printf( + /* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */ + __( 'Your account has been activated. You may now log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), + network_site_url( 'wp-login.php', 'login' ), + $signup->user_login, + $signup->user_email, + wp_lostpassword_url() + ); + } else { + printf( + /* translators: 1: site URL, 2: username, 3: user email, 4: lost password URL */ + __( 'Your site at %1$s is active. You may now log in to your site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.' ), + sprintf( '%1$s', $signup->domain ), + $signup->user_login, + $signup->user_email, + wp_lostpassword_url() + ); + } + echo '

'; + } else { + ?> +

get_error_message(); ?>

-

+ } + } else { + $url = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : ''; + $user = get_userdata( (int) $result['user_id'] ); + ?> +

user_login; ?>

@@ -159,8 +161,8 @@ get_header( 'wp-activate' );

diff --git a/wp-admin/freedoms.php b/wp-admin/freedoms.php index 110959449d..ecf44a3ebc 100644 --- a/wp-admin/freedoms.php +++ b/wp-admin/freedoms.php @@ -17,6 +17,14 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); $is_privacy_notice = isset( $_GET['privacy-notice'] ); +if ( $is_privacy_notice ) { + $freedoms_class = ''; + $privacy_class = ' nav-tab-active'; +} else { + $freedoms_class = ' nav-tab-active'; + $privacy_class = ''; +} + ?>
@@ -29,8 +37,8 @@ $is_privacy_notice = isset( $_GET['privacy-notice'] ); diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 4fd93e2e60..7fd8c0cd49 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -1817,21 +1817,20 @@ if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) { } _e( 'If you do not remember your credentials, you should contact your web host.' ); + $hostname_value = esc_attr( $hostname ); + if ( ! empty( $port ) ) { + $hostname_value .= ":$port"; + } + $password_value = ''; -if ( defined( 'FTP_PASS' ) ) { - $password_value = '*****'; -} + if ( defined( 'FTP_PASS' ) ) { + $password_value = '*****'; + } ?>