WP_Network_Query::parse_query() WordPress Method
The WP_Network_Query::parse_query() method is used to parse a network query and set up the class for the network query.
WP_Network_Query::parse_query( string|array $query = '' ) #
Parses arguments passed to the network query with default query parameters.
Parameters
- $query
(string|array)(Optional)WP_Network_Query arguments. See WP_Network_Query::__construct()
Default value: ''
Source
File: wp-includes/class-wp-network-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 network query vars have been parsed.
*
* @since 4.6.0
*
* @param WP_Network_Query $query The WP_Network_Query instance (passed by reference).
*/
do_action_ref_array( 'parse_network_query', array( &$this ) );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |