Commit Graph

55 Commits

Author SHA1 Message Date
Scott Taylor
e7ffad7fac 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.

Built from https://develop.svn.wordpress.org/trunk@38275


git-svn-id: http://core.svn.wordpress.org/trunk@38216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-18 18:21:31 +00:00
Sergey Biryukov
2443c89ee0 Docs: Clarify the fields argument description in WP_Network_Query::__construct().
See #32504.
Built from https://develop.svn.wordpress.org/trunk@38104


git-svn-id: http://core.svn.wordpress.org/trunk@38045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-19 13:18:28 +00:00
Sergey Biryukov
a7c72c31cf Multisite: Correct default value for orderby in WP_Network_Query::__construct().
Add a unit test.

See #32504.
Built from https://develop.svn.wordpress.org/trunk@38102


git-svn-id: http://core.svn.wordpress.org/trunk@38043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-19 13:10:29 +00:00
Jeremy Felt
7b5cd0c021 Multisite: Don't store max_num_pages in WP_Network_Query query cache.
This value can be easily calculated with available data.

Props spacedmonkey.
Fixes #32504.

Built from https://develop.svn.wordpress.org/trunk@38003


git-svn-id: http://core.svn.wordpress.org/trunk@37944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-07 15:52:28 +00:00
Jeremy Felt
f111fdb69a Multisite: Introduce WP_Network_Query.
Provides a consistent way to query `$wpdb->site` for `WP_Network` objects based on domain, path, network ID, and (main) site ID.

Introduces and uses update_network_cache() and _prime_network_caches() to maintain a cached list of WP_Network objects for use in multiple queries.

Props flixos90.
See #32504.

Built from https://develop.svn.wordpress.org/trunk@37894


git-svn-id: http://core.svn.wordpress.org/trunk@37835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-28 21:27:30 +00:00