Commit Graph

10 Commits

Author SHA1 Message Date
Boone Gorges f730861b90 Use `WP_Term_Query` when transforming tax queries.
This change allows tax query transformations to be cached.

Props spacedmonkey.
Fixes #37038.
Built from https://develop.svn.wordpress.org/trunk@40918


git-svn-id: http://core.svn.wordpress.org/trunk@40768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-21 03:57:42 +00:00
Boone Gorges 5fc3bbbfd2 Don't double-escape `terms` payload in `WP_Tax_Query::transform_query()`.
`terms` values are passed through `sanitize_term_field()` with the 'db'
flag, which add slashes. Because `terms` are subsequently run through
`esc_sql()`, these slashes must be removed. See [36348], which added
a similar step to sanitization in `get_terms()`.

Props bcworkz.
Fixes #39315.
Built from https://develop.svn.wordpress.org/trunk@39662


git-svn-id: http://core.svn.wordpress.org/trunk@39602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 19:40:19 +00:00
Gary Pendergast af69f4ab1a General: Restore usage of `$wpdb`, instead of `$this->db`.
Hiding the `$wpdb` global behind a property decreases the readability of the code, as well as causing irrelevant output when dumping an object.

Reverts [38275], [38278], [38279], [38280], [38387].
See #37699.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-10 06:38:31 +00:00
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 d851a2cded Taxonomy: Correct `WP_Error` usage in `WP_Tax_Query::clean_query()` and `WP_Tax_Query::transform_query()`.
Fixes #37389.
Built from https://develop.svn.wordpress.org/trunk@38079


git-svn-id: http://core.svn.wordpress.org/trunk@38020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-17 16:33:30 +00:00
Drew Jaynes fe3b007fdd Docs: Remove inline `@see` tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Boone Gorges 20b1b2098a Use `LEFT JOIN` when building `WP_Tax_Query` SQL.
`LEFT JOIN` ensures that `NOT EXISTS` queries will not miss posts that have
no taxonomy data whatsoever.

Props swissspidy, crstauf.
Fixes #36343.
Built from https://develop.svn.wordpress.org/trunk@37184


git-svn-id: http://core.svn.wordpress.org/trunk@37151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-12 20:37:26 +00:00
John Blackbourn aace0e33c1 Correct some `@param` doc names in the `WP_Tax_Query` and `WP_User_Query` classes.
See #32246

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


git-svn-id: http://core.svn.wordpress.org/trunk@35880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-14 02:50:27 +00:00
Drew Jaynes bbe7044030 Docs: Add a file header to wp-includes/class-wp-tax-query.php, introduced in [33760].
Also clarifies the class DocBlock summary and description for `WP_Tax_Query`.

See #33413. See #33701.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 13:16:30 +00:00
Scott Taylor fa0dc526f4 Taxonomy: move `WP_Tax_Query` into its own file. `taxonomy.php` loads the new files, so this is 100% BC if someone is loading `taxonomy.php` directly. New files created using `svn cp`.
Creates: 
`class-wp-tax-query.php` 
`taxonomy-functions.php` 

`taxonomy.php` contains only top-level code. Class file only contains the class. Functions file only contains functions.

See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 12:49:21 +00:00