WP_Comment_Query::parse_query() WordPress Method
The parse_query() method is used to parse the query variables for a WP_Comment_Query object. This is used internally by the class to generate the SQL query, but can also be used by other classes to modify the query.
WP_Comment_Query::parse_query( string|array $query = '' ) #
Parse arguments passed to the comment query with default query parameters.
Parameters
- $query
(string|array)(Optional)WP_Comment_Query arguments. See WP_Comment_Query::__construct()
Default value: ''
Source
File: wp-includes/class-wp-comment-query.php
public function parse_query( $query = '' ) { if ( empty( $query ) ) { $query = $this->query_vars; } $this->query_vars = wp_parse_args( $query, $this->query_var_defaults ); /** * Fires after the comment query vars have been parsed. * * @since 4.2.0 * * @param WP_Comment_Query $query The WP_Comment_Query instance (passed by reference). */ do_action_ref_array( 'parse_comment_query', array( &$this ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.2.0 | Introduced. |