General: Fix some precision alignment formatting warnings.

The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2017-11-26 23:57:55 +00:00
parent 611c090b41
commit c90cfa3b50
63 changed files with 265 additions and 262 deletions

View File

@ -277,8 +277,7 @@ function wp_update_link( $linkdata ) {
$link = wp_slash( $link ); $link = wp_slash( $link );
// Passed link category list overwrites existing category list if not empty. // Passed link category list overwrites existing category list if not empty.
if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) && 0 != count( $linkdata['link_category'] ) )
&& 0 != count( $linkdata['link_category'] ) )
$link_cats = $linkdata['link_category']; $link_cats = $linkdata['link_category'];
else else
$link_cats = $link['link_category']; $link_cats = $link['link_category'];

View File

@ -628,8 +628,10 @@ function install_plugin_information() {
) ); ) );
?> ?>
<div class="counter-container"> <div class="counter-container">
<span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>" <span class="counter-label">
target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span> <a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a>
</span>
<span class="counter-back"> <span class="counter-back">
<span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span> <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
</span> </span>

View File

@ -65,6 +65,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] ) if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
&& ! current_user_can( $ptype->cap->edit_others_posts ) ) { && ! current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( $update ) { if ( $update ) {
if ( 'page' == $post_data['post_type'] ) if ( 'page' == $post_data['post_type'] )
return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) ); return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );

View File

@ -380,9 +380,10 @@ function populate_options() {
$timezone_string = ''; $timezone_string = '';
$gmt_offset = 0; $gmt_offset = 0;
/* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14) /*
or a valid timezone string (America/New_York). See https://secure.php.net/manual/en/timezones.php * translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
for all timezone strings supported by PHP. * or a valid timezone string (America/New_York). See https://secure.php.net/manual/en/timezones.php
* for all timezone strings supported by PHP.
*/ */
$offset_or_tz = _x( '0', 'default GMT offset or timezone string' ); $offset_or_tz = _x( '0', 'default GMT offset or timezone string' );
if ( is_numeric( $offset_or_tz ) ) if ( is_numeric( $offset_or_tz ) )

View File

@ -31,8 +31,8 @@ $taxonomy = $tax->name;
$title = $tax->labels->edit_item; $title = $tax->labels->edit_item;
if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) || if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) ||
! current_user_can( 'edit_term', $tag->term_id ) ! current_user_can( 'edit_term', $tag->term_id ) ) {
) {
wp_die( wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>', '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',

View File

@ -327,7 +327,6 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
?> ?>
</p> </p>
<p><?php _e( 'If you decide to go ahead with direct edits anyway, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p> <p><?php _e( 'If you decide to go ahead with direct edits anyway, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>
</div> </div>
<p> <p>
<a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a> <a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a>

View File

@ -1209,8 +1209,7 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age
$word = preg_quote($word, '#'); $word = preg_quote($word, '#');
$pattern = "#$word#i"; $pattern = "#$word#i";
if ( if ( preg_match($pattern, $author)
preg_match($pattern, $author)
|| preg_match($pattern, $email) || preg_match($pattern, $email)
|| preg_match($pattern, $url) || preg_match($pattern, $url)
|| preg_match($pattern, $comment) || preg_match($pattern, $comment)

View File

@ -473,8 +473,8 @@ if ( ! function_exists( 'array_replace_recursive' ) ) :
foreach ( array_keys( $head ) as $key ) { foreach ( array_keys( $head ) as $key ) {
if ( isset( $key, $bref ) && if ( isset( $key, $bref ) &&
isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) && isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
isset( $head[ $key ] ) && is_array( $head[ $key ] ) isset( $head[ $key ] ) && is_array( $head[ $key ] ) ) {
) {
$bref_stack[] = &$bref[ $key ]; $bref_stack[] = &$bref[ $key ];
$head_stack[] = $head[ $key ]; $head_stack[] = $head[ $key ];
} else { } else {

View File

@ -2751,8 +2751,8 @@ function wp_rel_nofollow_callback( $matches ) {
$rel = 'nofollow'; $rel = 'nofollow';
if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) || if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) ) {
) {
return "<a $text>"; return "<a $text>";
} }

View File

@ -2948,8 +2948,8 @@ function wp_resource_hints() {
foreach ( $atts as $attr => $value ) { foreach ( $atts as $attr => $value ) {
if ( ! is_scalar( $value ) || if ( ! is_scalar( $value ) ||
( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr )) ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr )) ) {
) {
continue; continue;
} }

View File

@ -2974,6 +2974,7 @@ function _wp_image_editor_choose( $args = array() ) {
if ( isset( $args['methods'] ) && if ( isset( $args['methods'] ) &&
array_diff( $args['methods'], get_class_methods( $implementation ) ) ) { array_diff( $args['methods'], get_class_methods( $implementation ) ) ) {
continue; continue;
} }
@ -3500,9 +3501,10 @@ function wp_enqueue_media( $args = array() ) {
'replace' => __( 'Replace' ), 'replace' => __( 'Replace' ),
'remove' => __( 'Remove' ), 'remove' => __( 'Remove' ),
'back' => __( 'Back' ), 'back' => __( 'Back' ),
/* translators: This is a would-be plural string used in the media manager. /*
If there is not a word you can use in your language to avoid issues with the * translators: This is a would-be plural string used in the media manager.
lack of plural support here, turn it into "selected: %d" then translate it. * If there is not a word you can use in your language to avoid issues with the
* lack of plural support here, turn it into "selected: %d" then translate it.
*/ */
'selected' => __( '%d selected' ), 'selected' => __( '%d selected' ),
'dragInfo' => __( 'Drag and drop to reorder media files.' ), 'dragInfo' => __( 'Drag and drop to reorder media files.' ),

View File

@ -600,8 +600,8 @@ function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {
$post->ID != $post_id || $post->ID != $post_id ||
'_thumbnail_id' != $meta_key || '_thumbnail_id' != $meta_key ||
'revision' == $post->post_type || 'revision' == $post->post_type ||
$post_id != $_REQUEST['preview_id'] $post_id != $_REQUEST['preview_id'] ) {
) {
return $value; return $value;
} }

View File

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