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()
More Arguments from WP_Network_Query::__construct( ... $query ) Array or query string of network query parameters.
  • network__in int[]
    Array of network IDs to include.
  • network__not_in int[]
    Array of network IDs to exclude.
  • count bool
    Whether to return a network count (true) or array of network objects.
    Default false.
  • fields string
    Network fields to return. Accepts 'ids' (returns an array of network IDs) or empty (returns an array of complete network objects).
  • number int
    Maximum number of networks to retrieve. Default empty (no limit).
  • offset int
    Number of networks to offset the query. Used to build LIMIT clause.
    Default 0.
  • no_found_rows bool
    Whether to disable the SQL_CALC_FOUND_ROWS query. Default true.
  • orderby string|array
    Network 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 disable ORDER BY clause. Default 'id'.
  • order string
    How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'.
  • domain string
    Limit results to those affiliated with a given domain.
  • domain__in string[]
    Array of domains to include affiliated networks for.
  • domain__not_in string[]
    Array of domains to exclude affiliated networks for.
  • path string
    Limit results to those affiliated with a given path.
  • path__in string[]
    Array of paths to include affiliated networks for.
  • path__not_in string[]
    Array of paths to exclude affiliated networks for.
  • search string
    Search term(s) to retrieve matching networks for.
  • update_network_cache bool
    Whether to prime the cache for found networks. Default true.

Default: ''


Top ↑

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 ) );
}

Top ↑

Hooks



Top ↑

Changelog

Changelog
Version Description
4.6.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.