Make WordPress Core


Ignore:
Timestamp:
03/22/2022 02:54:45 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use multi-line strings for the $this->request property in wp-includes/class-wp-*-query.php.

This further improves the readability by replacing implode() calls with string interpolation.

Follow-up to [52973].

Props jrf.
See #54728.

File:
1 edited

Legend:

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

    r52974 r52977  
    30013001        }
    30023002
    3003         $old_request = implode(
    3004             ' ',
    3005             array(
    3006                 "SELECT $found_rows $distinct $fields",
    3007                 "FROM {$wpdb->posts} $join",
    3008                 "WHERE 1=1 $where",
    3009                 $groupby,
    3010                 $orderby,
    3011                 $limits,
    3012             )
    3013         );
     3003        $old_request = "
     3004            SELECT $found_rows $distinct $fields
     3005            FROM {$wpdb->posts} $join
     3006            WHERE 1=1 $where
     3007            $groupby
     3008            $orderby
     3009            $limits
     3010        ";
    30143011
    30153012        $this->request = $old_request;
     
    30983095                // First get the IDs and then fill in the objects.
    30993096
    3100                 $this->request = implode(
    3101                     ' ',
    3102                     array(
    3103                         "SELECT $found_rows $distinct {$wpdb->posts}.ID",
    3104                         "FROM {$wpdb->posts} $join",
    3105                         "WHERE 1=1 $where",
    3106                         $groupby,
    3107                         $orderby,
    3108                         $limits,
    3109                     )
    3110                 );
     3097                $this->request = "
     3098                    SELECT $found_rows $distinct {$wpdb->posts}.ID
     3099                    FROM {$wpdb->posts} $join
     3100                    WHERE 1=1 $where
     3101                    $groupby
     3102                    $orderby
     3103                    $limits
     3104                ";
    31113105
    31123106                /**
Note: See TracChangeset for help on using the changeset viewer.