Sergey Biryukov
90a332c3f2
Docs: Correct description for domain
and path
arguments in WP_Network_Query::__construct()
.
...
See #32504 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38595 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-13 13:09:52 +00:00
Scott Taylor
148b09a79e
Query: use correct description in the docblock for $number
in WP_Comment_Query
, WP_Network_Query
, and WP_Site_Query
.
...
Props flixos90.
Fixes #37621 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38336 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-23 14:40:09 +00:00
Scott Taylor
4e55f2248b
Query: add a protected
field, $db
, (composition, as it were) to WP_*_Query
classes to hold the value for the database abstraction, instead of importing the global $wpdb
into every method that uses it. Reduces the number of global imports by 32.
...
See #37699 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38275 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 18:20:55 +00:00
Sergey Biryukov
a64a8ea726
Docs: Clarify the fields
argument description in WP_Site_Query::__construct()
.
...
Props ramiy.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38103 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 13:14:40 +00:00
Sergey Biryukov
38bcf065df
Multisite: Correct default values for orderby
and order
in WP_Site_Query::__construct()
.
...
Add a unit test.
Props ramiy, SergeyBiryukov.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38085 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 23:29:11 +00:00
Jeremy Felt
9f254e6fb2
Docs: Correct the description of the $network_id
in WP_Site_Query
.
...
Passing 0 for `network_id` results in a query across all networks.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38008 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-07 20:35:02 +00:00
Jeremy Felt
188902ee09
Multisite: Don't store max_num_pages
in WP_Site_Query
query cache.
...
This value can be easily calculated with available data.
Props spacedmonkey.
Fixes #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@38002 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-07 15:31:45 +00:00
Jeremy Felt
269512cd6b
Multisite: Remove unused site_count
property from WP_Site_Query
.
...
Related: [37837].
Props flixos90.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@37875 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 14:32:07 +00:00
Jeremy Felt
eb2ce329f1
Multisite: Cache found_sites
and max_num_pages
in WP_Site_Query
.
...
This avoids a second uncached query used to determine found rows. Instead, we can cache the number of found sites and the max number of pages for reuse when the same query is requested in the future.
Props spacedmonkey.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@37868 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-26 12:45:29 +00:00
Jeremy Felt
3d56328372
Multisite: Add search column support to WP_Site_Query
.
...
`domain` and/or `path` can be used to specify which column(s) should be searched.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@37735 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 23:08:30 +00:00
Jeremy Felt
381930974c
Multisite: Introduce WP_Site_Query
...
Provides a consistent way to query `$wpdb->blogs` for `WP_Site` objects based on domain, path, site ID, network ID, and more.
Introduces and uses `update_site_cache()` and `_prime_site_caches()` to maintain a cached list of `WP_Site` objects for use in multiple queries.
Props spacedmonkey, flixos90, DrewAPicture, jeremyfelt, ocean90.
See #35791 .
git-svn-id: https://develop.svn.wordpress.org/trunk@37477 602fd350-edb4-49c9-b593-d223f7449a82
2016-05-20 22:03:52 +00:00