Make WordPress Core


Ignore:
Timestamp:
01/12/2019 06:05:55 AM (5 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r44546 r44573  
    556556
    557557            $orderby_array            = array();
    558             $found_orderby_comment_ID = false;
     558            $found_orderby_comment_id = false;
    559559            foreach ( $ordersby as $_key => $_value ) {
    560560                if ( ! $_value ) {
     
    570570                }
    571571
    572                 if ( ! $found_orderby_comment_ID && in_array( $_orderby, array( 'comment_ID', 'comment__in' ) ) ) {
    573                     $found_orderby_comment_ID = true;
     572                if ( ! $found_orderby_comment_id && in_array( $_orderby, array( 'comment_ID', 'comment__in' ) ) ) {
     573                    $found_orderby_comment_id = true;
    574574                }
    575575
     
    594594
    595595            // To ensure determinate sorting, always include a comment_ID clause.
    596             if ( ! $found_orderby_comment_ID ) {
    597                 $comment_ID_order = '';
     596            if ( ! $found_orderby_comment_id ) {
     597                $comment_id_order = '';
    598598
    599599                // Inherit order from comment_date or comment_date_gmt, if available.
    600600                foreach ( $orderby_array as $orderby_clause ) {
    601601                    if ( preg_match( '/comment_date(?:_gmt)*\ (ASC|DESC)/', $orderby_clause, $match ) ) {
    602                         $comment_ID_order = $match[1];
     602                        $comment_id_order = $match[1];
    603603                        break;
    604604                    }
     
    606606
    607607                // If no date-related order is available, use the date from the first available clause.
    608                 if ( ! $comment_ID_order ) {
     608                if ( ! $comment_id_order ) {
    609609                    foreach ( $orderby_array as $orderby_clause ) {
    610610                        if ( false !== strpos( 'ASC', $orderby_clause ) ) {
    611                             $comment_ID_order = 'ASC';
     611                            $comment_id_order = 'ASC';
    612612                        } else {
    613                             $comment_ID_order = 'DESC';
     613                            $comment_id_order = 'DESC';
    614614                        }
    615615
     
    619619
    620620                // Default to DESC.
    621                 if ( ! $comment_ID_order ) {
    622                     $comment_ID_order = 'DESC';
    623                 }
    624 
    625                 $orderby_array[] = "$wpdb->comments.comment_ID $comment_ID_order";
     621                if ( ! $comment_id_order ) {
     622                    $comment_id_order = 'DESC';
     623                }
     624
     625                $orderby_array[] = "$wpdb->comments.comment_ID $comment_id_order";
    626626            }
    627627
Note: See TracChangeset for help on using the changeset viewer.