Constructor.
Sets up the network query, based on the query vars passed.
$querystring|arrayoptional
network__in int[]network__not_in int[]count boolfields string'ids' (returns an array of network IDs) or empty (returns an array of complete network objects). number intoffset intno_found_rows boolSQL_CALC_FOUND_ROWS query. Default true.orderby string|array'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'ASC', 'DESC'. Default 'ASC'.domain stringdomain__in string[]domain__not_in string[]path stringpath__in string[]path__not_in string[]search stringupdate_network_cache boolDefault:''
public function __construct( $query = '' ) {
$this->query_var_defaults = array(
'network__in' => '',
'network__not_in' => '',
'count' => false,
'fields' => '',
'number' => '',
'offset' => '',
'no_found_rows' => true,
'orderby' => 'id',
'order' => 'ASC',
'domain' => '',
'domain__in' => '',
'domain__not_in' => '',
'path' => '',
'path__in' => '',
'path__not_in' => '',
'search' => '',
'update_network_cache' => true,
);
if ( ! empty( $query ) ) {
$this->query( $query );
}
}
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_network_query/__construct