From cb3d1777b1a1dcc6e1c86fcd6f4c116254ed8da1 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Wed, 15 Aug 2018 06:22:00 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@43569 602fd350-edb4-49c9-b593-d223f7449a82 --- src/index.php | 28 ++++---- src/wp-activate.php | 86 ++++++++++++------------ src/wp-admin/freedoms.php | 12 +++- src/wp-admin/includes/file.php | 26 +++---- src/wp-admin/includes/meta-boxes.php | 28 ++++---- src/wp-admin/includes/nav-menu.php | 36 ++-------- src/wp-admin/includes/plugin-install.php | 28 ++++---- src/wp-admin/includes/template.php | 32 +++++---- src/wp-admin/index.php | 28 ++++---- src/wp-admin/nav-menus.php | 47 ++++++------- src/wp-admin/network/site-info.php | 7 +- src/wp-admin/theme-editor.php | 4 +- src/wp-admin/update-core.php | 78 ++++++++++----------- src/wp-login.php | 6 +- src/xmlrpc.php | 4 +- 15 files changed, 214 insertions(+), 236 deletions(-) diff --git a/src/index.php b/src/index.php index 16c2a20e2d..c145b46088 100644 --- a/src/index.php +++ b/src/index.php @@ -26,24 +26,24 @@ wp_load_translations_early(); // Die with an error message $die = sprintf( - /* translators: %1$s: WordPress, %2$s: src, %3$s: build */ - __( 'You seem to be running %1$s from the %2$s directory. %1$s needs to be built and run from the %3$s directory before we can get started.' ), - 'WordPress', - 'src', - 'build' - ) . '

'; + /* translators: %1$s: WordPress, %2$s: src, %3$s: build */ + __( 'You seem to be running %1$s from the %2$s directory. %1$s needs to be built and run from the %3$s directory before we can get started.' ), + 'WordPress', + 'src', + 'build' +) . '

'; $die .= '

' . sprintf( /* translators: %s: WordPress */ - __( 'You can build %s by running:' ), - 'WordPress' - ) . '

'; + __( 'You can build %s by running:' ), + 'WordPress' +) . '

'; $die .= '

npm install && grunt build

'; $die .= '

' . sprintf( /* translators: %1$s: NPM URL, %2$s: Grunt URL */ - __( 'This requires NPM and Grunt. Read more about setting up your local development environment.' ), - 'https://www.npmjs.com/', - 'https://gruntjs.com/', - __( 'https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/' ) - ) . '

'; + __( 'This requires NPM and Grunt. Read more about setting up your local development environment.' ), + 'https://www.npmjs.com/', + 'https://gruntjs.com/', + __( 'https://make.wordpress.org/core/handbook/tutorials/installing-wordpress-locally/' ) +) . '

'; wp_die( $die, __( 'WordPress › Error' ) ); \ No newline at end of file diff --git a/src/wp-activate.php b/src/wp-activate.php index dc3a0d42f5..ecdfddd09b 100644 --- a/src/wp-activate.php +++ b/src/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/src/wp-admin/freedoms.php b/src/wp-admin/freedoms.php index 110959449d..ecf44a3ebc 100644 --- a/src/wp-admin/freedoms.php +++ b/src/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/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 4fd93e2e60..7fd8c0cd49 100644 --- a/src/wp-admin/includes/file.php +++ b/src/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 = '*****'; + } ?>