Coding Standards: Fix and whitelist variable names.

From the `WordPress.NamingConventions.ValidVariableName` sniff, this commit fixes/whitelists all `NotSnakeCaseMemberVar`, `MemberNotSnakeCase`, and `StringNotSnakeCase` violations. It also fixes a handful of the `NotSnakeCase` violations.

See #45934.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-01-12 06:06:48 +00:00
parent 3a697f7f46
commit 8656a65e1e
2 changed files with 13 additions and 13 deletions

View File

@ -555,7 +555,7 @@ class WP_Comment_Query {
preg_split( '/[,\s]/', $this->query_vars['orderby'] ); preg_split( '/[,\s]/', $this->query_vars['orderby'] );
$orderby_array = array(); $orderby_array = array();
$found_orderby_comment_ID = false; $found_orderby_comment_id = false;
foreach ( $ordersby as $_key => $_value ) { foreach ( $ordersby as $_key => $_value ) {
if ( ! $_value ) { if ( ! $_value ) {
continue; continue;
@ -569,8 +569,8 @@ class WP_Comment_Query {
$_order = $_value; $_order = $_value;
} }
if ( ! $found_orderby_comment_ID && in_array( $_orderby, array( 'comment_ID', 'comment__in' ) ) ) { if ( ! $found_orderby_comment_id && in_array( $_orderby, array( 'comment_ID', 'comment__in' ) ) ) {
$found_orderby_comment_ID = true; $found_orderby_comment_id = true;
} }
$parsed = $this->parse_orderby( $_orderby ); $parsed = $this->parse_orderby( $_orderby );
@ -593,24 +593,24 @@ class WP_Comment_Query {
} }
// To ensure determinate sorting, always include a comment_ID clause. // To ensure determinate sorting, always include a comment_ID clause.
if ( ! $found_orderby_comment_ID ) { if ( ! $found_orderby_comment_id ) {
$comment_ID_order = ''; $comment_id_order = '';
// Inherit order from comment_date or comment_date_gmt, if available. // Inherit order from comment_date or comment_date_gmt, if available.
foreach ( $orderby_array as $orderby_clause ) { foreach ( $orderby_array as $orderby_clause ) {
if ( preg_match( '/comment_date(?:_gmt)*\ (ASC|DESC)/', $orderby_clause, $match ) ) { if ( preg_match( '/comment_date(?:_gmt)*\ (ASC|DESC)/', $orderby_clause, $match ) ) {
$comment_ID_order = $match[1]; $comment_id_order = $match[1];
break; break;
} }
} }
// If no date-related order is available, use the date from the first available clause. // If no date-related order is available, use the date from the first available clause.
if ( ! $comment_ID_order ) { if ( ! $comment_id_order ) {
foreach ( $orderby_array as $orderby_clause ) { foreach ( $orderby_array as $orderby_clause ) {
if ( false !== strpos( 'ASC', $orderby_clause ) ) { if ( false !== strpos( 'ASC', $orderby_clause ) ) {
$comment_ID_order = 'ASC'; $comment_id_order = 'ASC';
} else { } else {
$comment_ID_order = 'DESC'; $comment_id_order = 'DESC';
} }
break; break;
@ -618,11 +618,11 @@ class WP_Comment_Query {
} }
// Default to DESC. // Default to DESC.
if ( ! $comment_ID_order ) { if ( ! $comment_id_order ) {
$comment_ID_order = 'DESC'; $comment_id_order = 'DESC';
} }
$orderby_array[] = "$wpdb->comments.comment_ID $comment_ID_order"; $orderby_array[] = "$wpdb->comments.comment_ID $comment_id_order";
} }
$orderby = implode( ', ', $orderby_array ); $orderby = implode( ', ', $orderby_array );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.1-beta1-44572'; $wp_version = '5.1-beta1-44573';
/** /**
* 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.