Make WordPress Core

Ticket #15249: 15249.2.diff

File 15249.2.diff, 1.8 KB (added by DrewAPicture, 11 years ago)

hook docs

  • src/wp-includes/comment.php

     
    456456                foreach ( $cols as $col )
    457457                        $searches[] = "$col LIKE '%$string%'";
    458458
    459                 return ' AND (' . implode(' OR ', $searches) . ')';
     459                $search = ' AND (' . implode(' OR ', $searches) . ')';
     460
     461                /**
     462                 * Filter the comment search SQL.
     463                 *
     464                 * @since 4.0.0
     465                 *
     466                 * @see WP_Comment_Query
     467                 *
     468                 * @param string $search   Comment search SQL.
     469                 * @param string $string   String to search for.
     470                 * @param array  $cols     List of columns to search.
     471                 * @param array  $searches List of SQL clauses for each column to search.
     472                 */
     473                return apply_filters( 'comment_search_sql', $search, $string, $cols, $searches );
    460474        }
    461475}
    462476
  • src/wp-includes/user.php

     
    809809                                $searches[] = "$col LIKE '$leading_wild" . like_escape($string) . "$trailing_wild'";
    810810                }
    811811
    812                 return ' AND (' . implode(' OR ', $searches) . ')';
     812                $search = ' AND (' . implode(' OR ', $searches) . ')';
     813
     814                /**
     815                 * Filter the user search SQL.
     816                 *
     817                 * @since 4.0.0
     818                 *
     819                 * @see WP_User_Query
     820                 *
     821                 * @param string $search   User search SQL.
     822                 * @param string $string   String to search for.
     823                 * @param array  $cols     List of columns to search.
     824                 * @param array  $searches List of SQL clauses for each column to search.
     825                 * @param bool   $wild     Whether wildcard searches are allowed. Default false.
     826                 */
     827                return apply_filters( 'user_search_sql', $search, $string, $cols, $searches, $wild );
    813828        }
    814829
    815830        /**