Coding Standards: Upgrade WPCS to 1.2.1.

This upgrade fixes quite a few false positives, as well as auto-fixing some indenting issues.

Fixes #45956.


Built from https://develop.svn.wordpress.org/trunk@44574


git-svn-id: http://core.svn.wordpress.org/trunk@44405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-01-12 06:41:52 +00:00
parent 8656a65e1e
commit 7a617078fa
43 changed files with 222 additions and 222 deletions

View File

@ -135,7 +135,7 @@ get_header( 'wp-activate' );
</form>
<?php
} else {
} else {
if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes ) ) {
$signup = $result->get_error_data();
?>
@ -202,8 +202,8 @@ get_header( 'wp-activate' );
<?php
endif;
}
}
?>
}
?>
</div>
</div>
<script type="text/javascript">

View File

@ -642,7 +642,7 @@ class Custom_Image_Header {
</tr>
<?php
endif;
if ( ! empty( $this->default_headers ) ) :
if ( ! empty( $this->default_headers ) ) :
?>
<tr>
<th scope="row"><?php _e( 'Default Images' ); ?></th>
@ -659,7 +659,7 @@ if ( ! empty( $this->default_headers ) ) :
</tr>
<?php
endif;
if ( get_header_image() ) :
if ( get_header_image() ) :
?>
<tr>
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
@ -672,7 +672,7 @@ if ( get_header_image() ) :
endif;
$default_image = sprintf( get_theme_support( 'custom-header', 'default-image' ), get_template_directory_uri(), get_stylesheet_directory_uri() );
if ( $default_image && get_header_image() != $default_image ) :
if ( $default_image && get_header_image() != $default_image ) :
?>
<tr>
<th scope="row"><?php _e( 'Reset Image' ); ?></th>
@ -741,7 +741,7 @@ endif;
do_action( 'custom_header_options' );
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
?>
?>
<?php submit_button( null, 'primary', 'save-header-options' ); ?>
</form>

View File

@ -1218,7 +1218,7 @@ class WP_List_Table {
endif;
$this->extra_tablenav( $which );
$this->pagination( $which );
?>
?>
<br class="clear" />
</div>

View File

@ -280,7 +280,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<?php } else { ?>
<div class="no-plugin-results"><?php _e( 'No plugins found. Try a different search.' ); ?></div>
<?php
}
}
}
/**
@ -392,7 +392,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<br class="clear" />
</div>
<?php
}
}
}
/**

View File

@ -1493,7 +1493,7 @@ class WP_Posts_List_Table extends WP_List_Table {
<?php
endif; // $bulk
if ( post_type_supports( $screen->post_type, 'author' ) ) :
if ( post_type_supports( $screen->post_type, 'author' ) ) :
$authors_dropdown = '';
if ( current_user_can( $post_type_object->cap->edit_others_posts ) ) :
@ -1524,7 +1524,7 @@ if ( post_type_supports( $screen->post_type, 'author' ) ) :
echo $authors_dropdown;}
endif; // post_type_supports author
if ( ! $bulk && $can_publish ) :
if ( ! $bulk && $can_publish ) :
?>
<div class="inline-edit-group wp-clearfix">

View File

@ -918,7 +918,7 @@ final class WP_Screen {
</div>
<?php
endif;
if ( $this->show_screen_options() ) :
if ( $this->show_screen_options() ) :
?>
<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
<button type="button" id="show-settings-link" class="button show-settings" aria-controls="screen-options-wrap" aria-expanded="false"><?php _e( 'Screen Options' ); ?></button>

View File

@ -286,7 +286,7 @@ class WP_Users_List_Table extends WP_List_Table {
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
*/
do_action( 'restrict_manage_users', $which );
?>
?>
</div>
<?php
/**

View File

@ -1002,7 +1002,7 @@ function confirm_delete_users( $users ) {
endif;
submit_button( __( 'Confirm Deletion' ), 'primary' );
?>
?>
</form>
<?php
return true;

View File

@ -696,9 +696,9 @@ function install_plugin_information() {
?>
<p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p>
<?php
}
}
if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
?>
<h3><?php _e( 'Reviews' ); ?></h3>
<p class="fyi-description"><?php _e( 'Read all reviews on WordPress.org or write your own!' ); ?></p>
@ -727,8 +727,8 @@ if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
</div>
<?php
}
}
if ( ! empty( $api->contributors ) ) {
}
if ( ! empty( $api->contributors ) ) {
?>
<h3><?php _e( 'Contributors' ); ?></h3>
<ul class="contributors">

View File

@ -1732,16 +1732,16 @@ function _admin_notice_post_locked() {
<?php if ( $preview_link ) { ?>
<a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e( 'Preview' ); ?></a>
<?php
}
}
// Allow plugins to prevent some users overriding the post lock
if ( $override ) {
if ( $override ) {
?>
<a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', wp_nonce_url( get_edit_post_link( $post->ID, 'url' ), 'lock-post_' . $post->ID ) ) ); ?>"><?php _e( 'Take over' ); ?></a>
<?php
}
}
?>
?>
</p>
</div>
<?php

View File

@ -826,10 +826,10 @@ 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">
<div id="menu-settings-column" class="metabox-holder<?php echo $metabox_holder_disabled_class; ?>">
@ -914,10 +914,10 @@ 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>
<?php

View File

@ -231,14 +231,14 @@ printf(
<?php if ( is_subdomain_install() ) { ?>
<input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
<?php
} else {
} else {
echo get_network()->domain . get_network()->path
?>
<input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
<?php
}
}
echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
?>
?>
</td>
</tr>
<tr class="form-field form-required">

View File

@ -228,7 +228,7 @@ switch ( $action ) {
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php
}
}
}
?>
@ -304,13 +304,13 @@ switch ( $action ) {
</tr>
<?php
endif; // $_wp_admin_css_colors
if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
?>
<tr class="user-comment-shortcuts-wrap">
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?></label> <?php _e( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>' ); ?></td>
</tr>
<?php endif; ?>
<?php endif; ?>
<tr class="show-admin-bar user-admin-bar-front-wrap">
<th scope="row"><?php _e( 'Toolbar' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Toolbar' ); ?></span></legend>
@ -414,7 +414,7 @@ endif;
<?php
endif; //!IS_PROFILE_PAGE
if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) {
if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) {
?>
<tr class="user-super-admin-wrap"><th><?php _e( 'Super Admin' ); ?></th>
<td>
@ -424,7 +424,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
<?php endif; ?>
</td></tr>
<?php } ?>
<?php } ?>
<tr class="user-first-name-wrap">
<th><label for="first_name"><?php _e( 'First Name' ); ?></label></th>

View File

@ -321,7 +321,7 @@ switch ( $wp_list_table->current_action() ) {
* @param int[] $userids Array of IDs for users being deleted.
*/
do_action( 'delete_user_form', $current_user, $userids );
?>
?>
<input type="hidden" name="action" value="dodelete" />
<?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
<?php else : ?>
@ -522,12 +522,12 @@ switch ( $wp_list_table->current_action() ) {
<?php
endif;
if ( ! empty( $messages ) ) {
if ( ! empty( $messages ) ) {
foreach ( $messages as $msg ) {
echo $msg;
}
}
?>
}
?>
<div class="wrap">
<h1 class="wp-heading-inline">

View File

@ -24,7 +24,7 @@
*/
return;
endif;
?>
?>
<?php // You can start editing here -- including this comment! ?>

View File

@ -40,12 +40,12 @@
endif;
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) :
if ( $description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $description; ?></p>
<?php
endif;
?>
?>
<button class="secondary-toggle"><?php _e( 'Menu and widgets', 'twentyfifteen' ); ?></button>
</div><!-- .site-branding -->
</header><!-- .site-header -->

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -19,7 +19,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -21,7 +21,7 @@
<?php
endif;
if ( is_single() ) :
if ( is_single() ) :
the_title( '<h1 class="entry-title">', '</h1>' );
else :
the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );

View File

@ -30,6 +30,6 @@
get_search_form();
endif;
?>
?>
</div><!-- .page-content -->
</section><!-- .no-results -->

View File

@ -39,7 +39,7 @@
endif;
$description = get_bloginfo( 'description', 'display' );
if ( $description || is_customize_preview() ) :
if ( $description || is_customize_preview() ) :
?>
<p class="site-description"><?php echo $description; ?></p>
<?php endif; ?>

View File

@ -113,7 +113,7 @@ if ( have_comments() ) :
<?php
endif; // post pass
// Return comment threading information (https://www.ietf.org/rfc/rfc4685.txt)
if ( $comment->comment_parent == 0 ) : // This comment is top level
if ( $comment->comment_parent == 0 ) : // This comment is top level
?>
<thr:in-reply-to ref="<?php the_guid(); ?>" href="<?php the_permalink_rss(); ?>" type="<?php bloginfo_rss( 'html_type' ); ?>" />
<?php

View File

@ -66,7 +66,7 @@ do_action( 'rss_tag_pre', 'atom' );
* @since 3.2.0
*/
do_action( 'atom_author' );
?>
?>
</author>
<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss(); ?>]]></title>
<link rel="alternate" type="<?php bloginfo_rss( 'html_type' ); ?>" href="<?php the_permalink_rss(); ?>" />

View File

@ -116,7 +116,7 @@ do_action( 'rss_tag_pre', 'rss2-comments' );
* @param int $comment_post->ID The ID of the post the comment is connected to.
*/
do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
?>
?>
</item>
<?php
endwhile;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta1-44573';
$wp_version = '5.1-beta1-44574';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -131,7 +131,7 @@ class WP_Widget_Archives extends WP_Widget {
?>
</ul>
<?php
}
}
echo $args['after_widget'];
}

View File

@ -1118,9 +1118,9 @@ switch ( $action ) {
if( d.value != '' )
d.value = '';
<?php
}
}
?>
}
}
?>
d.focus();
d.select();
} catch(e){}

View File

@ -139,9 +139,9 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
<?php if ( $errmsg = $errors->get_error_message( 'blog_title' ) ) { ?>
<p class="error"><?php echo $errmsg; ?></p>
<?php
}
}
echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" />';
?>
?>
<?php
// Site Language.