Commit Graph

8 Commits

Author SHA1 Message Date
Boone Gorges 9783a3df6b Query: Allow the hyphen-prefix-for-search-exclusion feature to be disabled by filter.
WordPress 4.4 introduced "hyphen exclusion" for search terms, so that
"foo -bar" would return posts containing "foo" AND not containing "bar".
The new filter 'wp_query_use_hyphen_for_exclusion' allows developers
to disable this feature when it's known that their content will contain
semantically important leading hyphens.

Props chriseverson, choongsavvii.
Fixes #38099.
Built from https://develop.svn.wordpress.org/trunk@38792


git-svn-id: http://core.svn.wordpress.org/trunk@38735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 20:06:28 +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
Boone Gorges 132f3d0d19 Query: Eliminate unnecessary `wp_list_filter()` call in `get_queried_object()`.
The refactor in [30711] swapped out the old `queries` property for the
new `queried_terms`, but should also have gotten rid of the now-
superfluous `wp_list_filter()` call.

Fixes #37962.
Built from https://develop.svn.wordpress.org/trunk@38586


git-svn-id: http://core.svn.wordpress.org/trunk@38529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 19:49:29 +00:00
Boone Gorges 163d59f8e1 Query: Avoid PHP notice in `get_queried_object()` when query contains `NOT EXISTS` tax query.
Props johnjamesjacoby.
See #37962.
Built from https://develop.svn.wordpress.org/trunk@38585


git-svn-id: http://core.svn.wordpress.org/trunk@38528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 19:37:38 +00:00
Dion Hulse 227a80eba3 Query: Use `AND` in a SQL query rather than `&&`.
This appears to have been the only instance of `&&` being used in SQL, so for consistency lets remove it.

Props scrappy@hub.org.
Fixes #37903.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 05:11:31 +00:00
Scott Taylor af71985625 Query: r38356, you were not long for this world.
Fixes #37830.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:53:29 +00:00
Scott Taylor faccc617fb Query: collapse several of the `is_*` methods using `__call()`. Add `@method` annotations.
Fixes #37830.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-25 19:42:43 +00:00
Scott Taylor d5f28fdad8 Query: move `WP_Query` into its own file via `svn cp`.
See #37827.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-25 17:20:38 +00:00