[ Index ]

WordPress 5.4.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    




/wp-includes/ -> class-wp-comment-query.php (summary)

Comment API: WP_Comment_Query class

File Size: 1180 lines (44 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Comment_Query:: (11 methods):

Class: WP_Comment_Query  - X-Ref

Core class used for querying comments.

__call( $name, $arguments )   X-Ref
Make private/protected methods readable for backward compatibility.

param: string   $name      Method to call.
param: array    $arguments Arguments to pass when calling.
return: mixed|false Return value of the callback, false otherwise.

__construct( $query = '' )   X-Ref

Sets up the comment query, based on the query vars passed.

param: string|array $query {

parse_query( $query = '' )   X-Ref
Parse arguments passed to the comment query with default query parameters.

param: string|array $query WP_Comment_Query arguments. See WP_Comment_Query::__construct()

query( $query )   X-Ref
Sets up the WordPress query for retrieving comments.

param: string|array $query Array or URL query string of parameters.
return: array|int List of comments, or number of comments when 'count' is passed as a query var.

get_comments()   X-Ref
Get a list of comments matching the query vars.

return: int|array List of comments or number of found comments if `$count` argument is true.

get_comment_ids()   X-Ref
Used internally to get a list of comment IDs matching the query vars.

return: int|array A single count of comment IDs if a count query. An array of comment IDs if a full query.

set_found_comments()   X-Ref
Populates found_comments and max_num_pages properties for the current
query if the limit clause was used.

fill_descendants( $comments )   X-Ref
Fetch descendants for located comments.

Instead of calling `get_children()` separately on each child comment, we do a single set of queries to fetch
the descendant trees for all matched top-level comments.

param: WP_Comment[] $comments Array of top-level comments whose descendants should be filled in.
return: array

get_search_sql( $string, $cols )   X-Ref
Used internally to generate an SQL string for searching across multiple columns

param: string $string
param: array $cols
return: string

parse_orderby( $orderby )   X-Ref
Parse and sanitize 'orderby' keys passed to the comment query.

param: string $orderby Alias for the field to order by.
return: string|false Value to used in the ORDER clause. False otherwise.

parse_order( $order )   X-Ref
Parse an 'order' query variable and cast it to ASC or DESC as necessary.

param: string $order The 'order' query variable.
return: string The sanitized 'order' query variable.

Generated: Tue May 19 15:51:04 2020 Cross-referenced by PHPXref 0.7.1