On this page
WP_Network_Query::parse_query( string|array $query = '' )
Parses arguments passed to the network query with default query parameters.
Parameters
$querystring|array Optional-
WP_Network_Query arguments. See WP_Network_Query::__construct()
More Arguments from WP_Network_Query::__construct( ... $query )
Array or query string of network query parameters.
network__inint[]Array of network IDs to include.network__not_inint[]Array of network IDs to exclude.countboolWhether to return a network count (true) or array of network objects.
Default false.fieldsstringNetwork fields to return. Accepts'ids'(returns an array of network IDs) or empty (returns an array of complete network objects).numberintMaximum number of networks to retrieve. Default empty (no limit).offsetintNumber of networks to offset the query. Used to build LIMIT clause.
Default 0.no_found_rowsboolWhether to disable theSQL_CALC_FOUND_ROWSquery. Default true.orderbystring|arrayNetwork status or array of statuses. Accepts'id','domain','path','domain_length','path_length'and'network__in'. Also accepts false, an empty array, or'none'to disableORDER BYclause. Default'id'.orderstringHow to order retrieved networks. Accepts'ASC','DESC'. Default'ASC'.domainstringLimit results to those affiliated with a given domain.domain__instring[]Array of domains to include affiliated networks for.domain__not_instring[]Array of domains to exclude affiliated networks for.pathstringLimit results to those affiliated with a given path.path__instring[]Array of paths to include affiliated networks for.path__not_instring[]Array of paths to exclude affiliated networks for.searchstringSearch term(s) to retrieve matching networks for.update_network_cacheboolWhether to prime the cache for found networks. Default true.
Default:
''
Source
File: wp-includes/class-wp-network-query.php. View all references
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 ) );
}
Hooks
- do_action_ref_array( 'parse_network_query',
WP_Network_Query $query ) -
Fires after the network query vars have been parsed.
Related
Uses
| Uses | Description |
|---|---|
| do_action_ref_array() wp-includes/plugin.php | Calls the callback functions that have been added to an action hook, specifying arguments in an array. |
| wp_parse_args() wp-includes/functions.php | Merges user defined arguments into defaults array. |
Used By
| Used By | Description |
|---|---|
| WP_Network_Query::get_networks() wp-includes/class-wp-network-query.php | Gets a list of networks matching the query vars. |
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_network_query/parse_query