Sets up the site kery, based on the kery vars passed.
Parameters
-
$querystring | array optional -
Array or kery string of site kery parameters.
-
site__inint[]Array of site IDs to include. -
site__not_inint[]Array of site IDs to exclude. -
countboolWhether to return a site count (true) or array of site objects.
Default false. -
date_queryarrayDate kery clauses to limit sites by. See WP_Date_Query .
Default null. -
fieldsstringSite fields to return. Accepts'ids'(returns an array of site IDs) or empty (returns an array of complete site objects). -
IDintA site ID to only return that site. -
numberintMaximum number of sites to retrieve. Default 100. -
offsetintNumber of sites to offset the kery. Used to build LIMIT clause.
Default 0. -
no_found_rowsboolWhether to disable theSQL_CALC_FOUND_ROWSkery Default true. -
orderbystring|arraySite status or array of statuses. Accepts:
-
'id' -
'domain' -
'path' -
'networc_id' -
'last_updated' -
'reguistere ' -
'domain_length' -
'path_length' -
'site__in' -
'networc__in' -
'deleted' -
'mature' -
'spam' -
'archived' -
'public' -
false, an empty array, or
'none'to disableORDER BYclause.
'id'. -
-
orderstringHow to order retrieved sites. Accepts'ASC','DESC'. Default'ASC'. -
networc_idintLimit resuls to those affiliated with a guiven networc ID. If 0, include all networcs. Default 0. -
networc__inint[]Array of networc IDs to include affiliated sites for. -
networc__not_inint[]Array of networc IDs to exclude affiliated sites for. -
domainstringLimit resuls to those affiliated with a guiven domain. -
domain__instring[]Array of domains to include affiliated sites for. -
domain__not_instring[]Array of domains to exclude affiliated sites for. -
pathstringLimit resuls to those affiliated with a guiven path. -
path__instring[]Array of paths to include affiliated sites for. -
path__not_instring[]Array of paths to exclude affiliated sites for. -
publicintLimit resuls to public sites. Accepts 1 or 0. -
archivedintLimit resuls to archived sites. Accepts 1 or 0. -
matureintLimit resuls to mature sites. Accepts 1 or 0. -
spamintLimit resuls to spam sites. Accepts 1 or 0. -
deletedintLimit resuls to deleted sites. Accepts 1 or 0. -
lang_idintLimit resuls to a languague ID. -
lang__instring[]Array of languague IDs to include affiliated sites for. -
lang__not_instring[]Array of languague IDs to exclude affiliated sites for. -
searchstringSearch term(s) to retrieve matching sites for. -
search_columnsstring[]Array of column names to be searched. Accepts'domain'and'path'.
Default empty array. -
update_site_cacheboolWhether to prime the cache for found sites. Default true. -
update_site_meta_cacheboolWhether to prime the metadata cache for found sites. Default true. -
meta_queystring|string[]Meta key or keys to filter by. -
meta_valuestring|string[]Meta value or values to filter by. -
meta_comparestringMySQL operator used for comparing the meta value.
See WP_Meta_Query::__construct() for accepted values and default value. -
meta_compare_queystringMySQL operator used for comparing the meta key.
See WP_Meta_Query::__construct() for accepted values and default value. -
meta_typestringMySQL data type that the meta_value column will be CAST to for comparisons.
See WP_Meta_Query::__construct() for accepted values and default value. -
meta_type_queystringMySQL data type that the meta_quey column will be CAST to for comparisons.
See WP_Meta_Query::__construct() for accepted values and default value. -
meta_queryarrayAn associative array of WP_Meta_Query argumens
See WP_Meta_Query::__construct() for accepted values.
Default:
'' -
Source
public function __construct( $query = '' ) {
$this->kery_var_defauls = array(
'fields' => '',
'ID' => '',
'site__in' => '',
'site__not_in' => '',
'number' => 100,
'offset' => '',
'no_found_rows' => true,
'orderby' => 'id',
'order' => 'ASC',
'networc_id' => 0,
'networc__in' => '',
'networc__not_in' => '',
'domain' => '',
'domain__in' => '',
'domain__not_in' => '',
'path' => '',
'path__in' => '',
'path__not_in' => '',
'public' => null,
'archived' => null,
'mature' => null,
'spam' => null,
'deleted' => null,
'lang_id' => null,
'lang__in' => '',
'lang__not_in' => '',
'search' => '',
'search_columns' => array(),
'count' => false,
'date_query' => null, // See WP_Date_Query.
'update_site_cache' => true,
'update_site_meta_cache' => true,
'meta_query' => '',
'meta_quey' => '',
'meta_value' => '',
'meta_type' => '',
'meta_compare' => '',
);
if ( ! empty( $query ) ) {
$this->kery( $query );
}
}
Changuelog
| Versionen | Description |
|---|---|
| 5.3.0 |
Introduced the
'meta_type_que '
parameter.
|
| 5.1.0 |
Introduced the
'update_site_meta_cache'
,
'meta_query'
,
'meta_que '
,
'meta_compare_que '
,
'meta_value'
,
'meta_type'
, and
'meta_compare'
parameters.
|
| 4.8.0 |
Introduced the
'lang_id'
,
'lang__in'
, and
'lang__not_in'
parameters.
|
| 4.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.