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
This commit is contained in:
Gary Pendergast 2018-08-15 06:22:26 +00:00
parent 08af3900c3
commit 8244397ffb
14 changed files with 187 additions and 209 deletions

View File

@ -76,7 +76,9 @@ get_header( 'wp-activate' );
<div id="signup-content" class="widecolumn">
<div class="wp-activate-container">
<?php if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) { ?>
<?php
if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) {
?>
<h2><?php _e( 'Activation Key Required' ); ?></h2>
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( 'wp-activate.php' ); ?>">
@ -90,7 +92,7 @@ get_header( 'wp-activate' );
</form>
<?php
} else {
} else {
$key = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key'];
$result = wpmu_activate_signup( $key );
@ -160,7 +162,7 @@ get_header( 'wp-activate' );
<?php
endif;
}
}
}
?>
</div>
</div>

View File

@ -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 = '';
}
?>
<div class="wrap about-wrap full-width-layout">
@ -29,8 +37,8 @@ $is_privacy_notice = isset( $_GET['privacy-notice'] );
<h2 class="nav-tab-wrapper wp-clearfix">
<a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
<a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a>
<a href="freedoms.php" class="nav-tab<?php if ( ! $is_privacy_notice ) { echo ' nav-tab-active'; } ?>"><?php _e( 'Freedoms' ); ?></a>
<a href="freedoms.php?privacy-notice" class="nav-tab<?php if ( $is_privacy_notice ) { echo ' nav-tab-active'; } ?>"><?php _e( 'Privacy' ); ?></a>
<a href="freedoms.php" class="nav-tab<?php echo $freedoms_class; ?>"><?php _e( 'Freedoms' ); ?></a>
<a href="freedoms.php?privacy-notice" class="nav-tab<?php echo $privacy_class; ?>"><?php _e( 'Privacy' ); ?></a>
</h2>
<?php if ( $is_privacy_notice ) : ?>

View File

@ -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' ) ) {
if ( defined( 'FTP_PASS' ) ) {
$password_value = '*****';
}
}
?>
</p>
<label for="hostname">
<span class="field-title"><?php _e( 'Hostname' ); ?></span>
<input name="hostname" type="text" id="hostname" aria-describedby="request-filesystem-credentials-desc" class="code" placeholder="<?php esc_attr_e( 'example: www.wordpress.org' ); ?>" value="
<?php
echo esc_attr( $hostname );
if ( ! empty( $port ) ) {
echo ":$port";}
?>
"<?php disabled( defined( 'FTP_HOST' ) ); ?> />
<input name="hostname" type="text" id="hostname" aria-describedby="request-filesystem-credentials-desc" class="code" placeholder="<?php esc_attr_e( 'example: www.wordpress.org' ); ?>" value="<?php echo $hostname_value; ?>"<?php disabled( defined( 'FTP_HOST' ) ); ?> />
</label>
<div class="ftp-username">
<label for="username">
@ -1858,12 +1857,7 @@ if ( defined( 'FTP_PASS' ) ) {
foreach ( $types as $name => $text ) :
?>
<label for="<?php echo esc_attr( $name ); ?>">
<input type="radio" name="connection_type" id="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $name ); ?>"
<?php
checked( $name, $connection_type );
echo $disabled;
?>
/>
<input type="radio" name="connection_type" id="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $name ); ?>" <?php checked( $name, $connection_type ); ?> <?php echo $disabled; ?> />
<?php echo $text; ?>
</label>
<?php

View File

@ -1350,16 +1350,14 @@ function attachment_id3_data_meta_box( $post ) {
}
foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) :
$value = '';
if ( ! empty( $meta[ $key ] ) ) {
$value = $meta[ $key ];
}
?>
<p>
<label for="title"><?php echo $label; ?></label><br />
<input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="
<?php
if ( ! empty( $meta[ $key ] ) ) {
echo esc_attr( $meta[ $key ] );
}
?>
" />
<input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="<?php echo esc_attr( $value ); ?>" />
</p>
<?php
endforeach;

View File

@ -435,11 +435,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
</li>
</ul><!-- .posttype-tabs -->
<div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel
<?php
echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>
">
<div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>">
<ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
<?php
$recent_args = array_merge(
@ -473,11 +469,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
</ul>
</div><!-- /.tabs-panel -->
<div class="tabs-panel
<?php
echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>
" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
<div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
<?php
if ( isset( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] ) ) {
$searched = esc_attr( $_REQUEST[ 'quick-search-posttype-' . $post_type_name ] );
@ -515,11 +507,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
</ul>
</div><!-- /.tabs-panel -->
<div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all
<?php
echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>
">
<div id="<?php echo $post_type_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>">
<?php if ( ! empty( $page_links ) ) : ?>
<div class="add-menu-item-pagelinks">
<?php echo $page_links; ?>
@ -771,11 +759,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
</li>
</ul><!-- .taxonomy-tabs -->
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel
<?php
echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>
">
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?> ">
<ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
<?php
$popular_terms = get_terms(
@ -792,11 +776,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
</ul>
</div><!-- /.tabs-panel -->
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all
<?php
echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>
">
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-all" class="tabs-panel tabs-panel-view-all <?php echo ( 'all' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?> ">
<?php if ( ! empty( $page_links ) ) : ?>
<div class="add-menu-item-pagelinks">
<?php echo $page_links; ?>
@ -815,11 +795,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
<?php endif; ?>
</div><!-- /.tabs-panel -->
<div class="tabs-panel
<?php
echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
?>
" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
<div class="tabs-panel <?php echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
<?php
if ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
$searched = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );

View File

@ -2184,16 +2184,20 @@ function _wp_admin_html_begin() {
* @since 2.2.0
*/
do_action( 'admin_xml_ns' );
?>
<?php language_attributes(); ?>>
language_attributes();
?>
>
<![endif]-->
<!--[if !(IE 8) ]><!-->
<html xmlns="http://www.w3.org/1999/xhtml" class="<?php echo $admin_html_class; ?>"
<?php
/** This action is documented in wp-admin/includes/template.php */
do_action( 'admin_xml_ns' );
?>
<?php language_attributes(); ?>>
language_attributes();
?>
>
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />

View File

@ -628,15 +628,16 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<h2 class="nav-tab-wrapper wp-clearfix">
<a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php echo $nav_tab_active_class; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a>
<?php if ( $num_locations && $menu_count ) : ?>
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab
<?php
if ( $num_locations && $menu_count ) {
$active_tab_class = '';
if ( $locations_screen ) {
echo ' nav-tab-active';}
?>
"><?php esc_html_e( 'Manage Locations' ); ?></a>
$active_tab_class = ' nav-tab-active';
}
?>
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php echo $active_tab_class; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a>
<?php
endif;
}
?>
</h2>
<?php
@ -694,8 +695,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
), admin_url( 'nav-menus.php' )
)
);
?>
">
?>
">
<span aria-hidden="true"><?php _ex( 'Edit', 'menu' ); ?></span><span class="screen-reader-text"><?php _e( 'Edit selected menu' ); ?></span>
</a>
</span>
@ -712,8 +713,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
), admin_url( 'nav-menus.php' )
)
);
?>
">
?>
">
<?php _ex( 'Use new menu', 'menu' ); ?>
</a>
</span>
@ -818,9 +819,9 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
endif;
$metabox_holder_disabled_class = '';
if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
$metabox_holder_disabled_class = ' metabox-holder-disabled';
}
}
?>
</div><!-- /manage-menus -->
<div id="nav-menus-frame" class="wp-clearfix">
@ -906,9 +907,9 @@ if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
endif;
$no_menus_style = '';
if ( $one_theme_location_no_menus ) {
if ( $one_theme_location_no_menus ) {
$no_menus_style = 'style="display: none;"';
}
}
?>
<div class="menu-settings" <?php echo $no_menus_style; ?>>
<h3><?php _e( 'Menu Settings' ); ?></h3>
@ -976,8 +977,8 @@ if ( $one_theme_location_no_menus ) {
), 'delete-nav_menu-' . $nav_menu_selected_id
)
);
?>
"><?php _e( 'Delete Menu' ); ?></a>
?>
"><?php _e( 'Delete Menu' ); ?></a>
</span><!-- END .delete-action -->
<?php endif; ?>
<div class="publishing-action">

View File

@ -193,12 +193,7 @@ if ( ! empty( $messages ) ) {
<fieldset>
<legend class="screen-reader-text"><?php _e( 'Set site attributes' ); ?></legend>
<?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
<label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1"
<?php
checked( (bool) $details->$field_key, true );
disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) );
?>
/>
<label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
<?php echo $field_label; ?></label><br/>
<?php endforeach; ?>
<fieldset>

View File

@ -296,8 +296,8 @@ else :
<p>
<?php
if ( is_writeable( $file ) ) {
?>
<strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
?>
<strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
<?php _e( 'This is a file in your current parent theme.' ); ?>
</p>
</div>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43568';
$wp_version = '5.0-alpha-43569';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -31,8 +31,8 @@ include( dirname( __FILE__ ) . '/wp-load.php' );
if ( isset( $_GET['rsd'] ) ) { // http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
?>
<?php echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>'; ?>
echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?' . '>';
?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
<service>
<engineName>WordPress</engineName>