Make WordPress Core


Ignore:
Timestamp:
04/26/2022 02:02:14 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Add missing documentation for WP_*_Query::get_search_sql() method parameters.

Includes renaming the $cols parameter to $columns for consistency across the classes.

Follow-up to [42876], [53272-53276].

See #54729.

File:
1 edited

Legend:

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

    r53272 r53280  
    11271127
    11281128    /**
    1129      * Used internally to generate an SQL string for searching across multiple columns
     1129     * Used internally to generate an SQL string for searching across multiple columns.
    11301130     *
    11311131     * @since 3.1.0
     
    11331133     * @global wpdb $wpdb WordPress database abstraction object.
    11341134     *
    1135      * @param string $search
    1136      * @param array  $cols
    1137      * @return string
    1138      */
    1139     protected function get_search_sql( $search, $cols ) {
     1135     * @param string   $search  Search string.
     1136     * @param string[] $columns Array of columns to search.
     1137     * @return string Search SQL.
     1138     */
     1139    protected function get_search_sql( $search, $columns ) {
    11401140        global $wpdb;
    11411141
     
    11431143
    11441144        $searches = array();
    1145         foreach ( $cols as $col ) {
    1146             $searches[] = $wpdb->prepare( "$col LIKE %s", $like );
     1145        foreach ( $columns as $column ) {
     1146            $searches[] = $wpdb->prepare( "$column LIKE %s", $like );
    11471147        }
    11481148
Note: See TracChangeset for help on using the changeset viewer.