1989 Commits

Author SHA1 Message Date
Sergey Biryukov
30988287b6 Embeds: Remove the external oEmbed tests for YouTube.
These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.6 branch.
See #42076, #32714, #23149.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@47481 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-22 13:45:45 +00:00
Sergey Biryukov
14bb858ed3 Update wp_kses_bad_protocol() to recognize : on uri attributes,
`wp_kses_bad_protocol()` makes sure to validate that uri attributes don’t contain invalid/or not allowed protocols. While this works fine in most cases, there’s a risk that by using the colon html5 named entity, one is able to bypass this function.

Brings r46895 to the 4.6 branch.

Props: xknown, nickdaugherty, peterwilsoncc.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@46914 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 18:45:47 +00:00
Jake Spurlock
15315e51a4 Backporting several bug fixes.
- Query: Remove the static query property.
- HTTP API: Protect against hex interpretation.
- Filesystem API: Prevent directory travelersals when creating new folders.
- Administration: Ensure that admin referer nonce is valid.
- REST API: Send a Vary: Origin header on GET requests.

Backports [46474], [46475], [46476], [46477], [46478], [46483], [46485] to the 4.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@46496 602fd350-edb4-49c9-b593-d223f7449a82
2019-10-14 19:01:10 +00:00
Jonathan Desrosiers
f4e42693a5 Fix for URL sanitization in wp_kses_bad_protocol_once().
Merges [45997] to the 4.6 branch.

Props irsdl, sstoqnov, whyisjake.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@46008 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 18:20:31 +00:00
Sergey Biryukov
e57576ef1d Improve handling the existing rel attribute in wp_rel_nofollow_callback().
Merges [45990] to the 4.6 branch.
Props xknown, sstoqnov.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@45998 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 17:52:01 +00:00
Jake Spurlock
d73484849f Remove _convert_urlencoded_to_entities() from the get_the_content() callback.
Merges [45937] to the 4.6 branch.

Props vortfu, whyisjake, peterwilsoncc


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@45956 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-04 16:37:44 +00:00
Jeremy Felt
ffd8c5336f Media: Remove invalid data from test data provider.
See [43922].


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@44004 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-12 23:35:51 +00:00
Jeremy Felt
9d7e7e4e0c Media: Improve verification of MIME file types.
Merges [43988] to the 4.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@43992 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-12 23:07:55 +00:00
John Blackbourn
9a6de1db91 General: Remove the version number from the readme file in the 4.6 branch.
See #42386


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@42101 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 18:06:26 +00:00
Gary Pendergast
b55674a862 Database: Restore numbered placeholders in wpdb::prepare().
[41496] removed support for numbered placeholders in queries send through `wpdb::prepare()`, which, despite being undocumented, were quite commonly used.

This change restores support for numbered placeholders (as well as a subset of placeholder formatting), while also adding extra checks to ensure the correct number of arguments are being passed to `wpdb::prepare()`, given the number of placeholders.

Merges [41662], [42056] to the 4.6 branch.
See #41925.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@42059 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 12:40:24 +00:00
Gary Pendergast
b6aa15830e Build/Test Tools: Pass correct $message argument to WP_UnitTestCase::setExpectedException() in Tests_Ajax_CompressionTest::test_logged_out() and Tests_Ajax_TagSearch::test_no_results().
PHPUnit 6.4.1 and earlier versions ignored the `'0'` value, causing the issue to go unnoticed.

Merge of [41870] to the 4.6 branch.

Props SergeyBiryukov.
See #42232.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@42053 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 09:09:18 +00:00
Aaron D. Campbell
f6b2b0e105 Database: Hardening to bring wpdb::prepare() inline with documentation.
`wpdb::prepare()` supports %s, %d, and %F as placeholders in the query string. Any other non-escaped % will be escaped.

Merges [41496] to 4.6 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@41499 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 18:12:56 +00:00
Aaron D. Campbell
eb67e43301 Database: Hardening for wpdb::prepare()
Previously if you passed an array of values for placeholders, additional values could be passed as well. Now additional values will be ignored.

Merges [41470] to 4.6 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@41473 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-19 14:59:26 +00:00
Weston Ruter
0fa19fef4d Customize: Fix phpunit tests after [40704] due to logic inversion error.
Merge of [40716] to the 4.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@40718 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 14:39:33 +00:00
John Blackbourn
dfdb88fe1f Build/Test tools: In Travis, skip some tests when not on trunk.
This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin

Fixes #39486

Merges [40241] to the 4.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@40249 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-08 00:50:43 +00:00
Aaron D. Campbell
893f5ba0ba Strip control characters before validating redirect.
Merges [40183] to 4.6 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@40185 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:40:20 +00:00
Aaron D. Campbell
9df5a81e7c Media: Improved media titles when created from filename.
Preserves spaces and generally creates more accurate, cleaner titles from filenames of uploaded media.

Merge of [38614] to the 4.6 branch.

Props joemcgill.
Fixes #37989.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38615 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-17 06:26:36 +00:00
Gary Pendergast
851a0018ed Database: Fall back to utf8 when utf8mb4 isn't supported.
Sometimes, `DB_CHARSET` will be set to `utf8mb4`, even if the current setup doesn't support `utf8mb4`. After [38442], this can cause significant character set failures, causing the connection to fall back to `latin1`.

Instead of doing this, we now check that the connection supports `utf8mb4` before trying to use it, and fall back to `utf8` when we need to.

Merge of [38580] to the 4.6 branch.
Fixes #37982.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38581 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-08 23:53:25 +00:00
Jeremy Felt
6f4e5aa08f Comments: Revert [38497]
Restore direct SQL query when fetching descendants.

See #37696, #37966.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38537 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-07 13:40:36 +00:00
Jeremy Felt
ba5bcd608d Comments: Don't do direct SQL query when fetching decendants.
The SQL query was built using the clauses compiled when querying for
top-level comments. But in cases where the top-level comment query
results are already in the cache, the SQL clauses are not built, and
so are unavailable for `fill_descendants()`. Instead, we call
`get_comments()`, using modified versions of the parameters passed
to the main `WP_Comment_Query` class.

Merge of [38446] to the 4.6 branch.

Props boonebgorges, Akeif, Rarst for testing.
Fixes #37696.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38497 602fd350-edb4-49c9-b593-d223f7449a82
2016-09-01 15:14:16 +00:00
Jeremy Felt
1991b01130 HTTP: Handle an edgecase within the URI parsing library included in Requests, where if a double slash exists at the start of the path the URL is passed to cURL malformed.
Merge of [38429] to the 4.6 branch.

Props dd32, flixos90 for initial patch.
Fixes #37733.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38485 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 22:00:53 +00:00
Jeremy Felt
dfef301082 Post Thumbnails: Prevent post thumbnail previews from spilling into other images.
After [38118], when previewing a page with a secondary loop, all post
thumbnails would be filtered to display the post thumbnail for the
page being previewed. This ensures `_wp_preview_post_thumbnail_filter()`
is only applied if the `$post_id` of the post meta being filtered is
equal to the post or page being previewed.

Merge of [38433] to the 4.6 branch.

Props swissspidy, joemcgill.
Fixes #37697.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38476 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 18:43:21 +00:00
Jeremy Felt
618795de08 Script Loader: Close the <link> tag in wp_resource_hints().
Adjusts tests to match markup change.

Merge of [38443] and [38447] to the 4.6 branch.

Props Chaos Engine, SergeyBiryukov, swissspidy.
Fixes #37800.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38473 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 17:25:03 +00:00
Dion Hulse
43c0908979 HTTP: Accept non-string values in cookies, fixing a regression since 4.5.
Props swissspidy.
Merges [38430] to the 4.6 branch.
Fixes #37768.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38461 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-31 06:06:34 +00:00
Boone Gorges
de57dece83 In is_object_in_term(), return error object rather than caching it.
This change prevents an error object from being stored in the cache,
and prevents notices from being thrown when plucking term IDs to put
into the relationship cache.

See #32044, #36814.

Merges [38277] to the 4.6 branch.

Props rpayne7264.
Fixes #37721.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38346 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-24 09:19:49 +00:00
Boone Gorges
d07d051220 Mail: Don't set Sender field when setting From.
[38058] changed `wp_mail()` so that it used PHPMailer's `setFrom()`
method rather than setting the From and FromName headers directly. See
behavior of setting the `Sender` field. This causes `mail` to be
called with the `-f` flag, which causes outgoing email to fail on some
server environments.

Merges [38286] to the 4.6 branch.

Props Clorith, iandunn, DrewAPicture.
Fixes #37736. 


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38287 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 02:20:04 +00:00
Dominik Schilling
26f2b4c78c Post Thumbnails: Restore thumbnail support for media files.
* Allow to add/remove a featured image to `attachment:audio` and `attachment:video` post types, see [27657].
* Change conditionals to check for theme OR post type support.
* Add tests for #12922.

Broken in [37658].

Merge of [38263] to the 4.6 branch.

Props flixos90, joemcgill, DrewAPicture, wonderboymusic.
See #12922.
See #37658.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38264 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-15 19:18:00 +00:00
Dominik Schilling
df44da314b Script Loader: Fix protocol-relative URLs for the preconnect relation type.
`wp_resource_hints()` parses the URL for the `preconnect` and `dns-prefetch` relation types to ensure correct values for both. While protocol-relative URLs are supported for `dns-prefetch`, the double slash was lost for `preconnect`.

Merge of [38255] to the 4.6 branch.

Props swissspidy, peterwilsoncc.
Props azaozz for review.
See #37652.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38256 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 18:39:39 +00:00
Aaron Jorbin
729ea0a9f2 Bootstrap/Load: Revert Plugin Global restoration around advance-cache.php.
Merges [38251] to the 4.6 branch.

First added in [37588] and later modified in [38224], the idea was to ensure that filters/actions added before `advance-cache.php` would not disappear if `advance-cache.php` overloaded the filters/actions with code such as `$wp_filter = array()`. This is an edge case and one that there is no documented case of existing.

This restores the behavior from WordPress 4.5 and before. It is strongly encouraged that developers using `advance-cache.php` to use the Plugins API that is available before the loading of `advance-cache.php` rather than directly interacting with any of the globals.

Props azaozz, jorbin, dd32 for review, pento for review, westi for investigation, ipstenu for research.

See #36819.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38252 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 16:01:09 +00:00
Jeremy Felt
4f229e19d3 Multisite: Use get_current_blog_id() in get_site() for current site.
The global `$current_blog` is not switched in `switch_to_blog()` and can
not be used to properly retrieve current switched site information.

Merge of [38217] to the 4.6 branch.

Props ocean90 for review.
Fixes #37607.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38231 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 16:19:58 +00:00
Gary Pendergast
85da7a0908 Boostrap/Load: Improve forward compatiblity of plugin global backup methods.
[37588] added methods to backup the plugin globals, for ensuring that advanced cache drop-ins don't overwrite hooks that've been added earlier in the load process.

The method for restoring the plugin globals wasn't compatible with the implementation of `WP_Hook` in #17817. `WP_Hook` implements `ArrayAccess`, so `_restore_plugin_globals()` was treating it as an array, and inadvertantly overwriting the `WP_Hook` object with a plain array.

To avoid having to re-write this code as part of #17817, we now use `add_filter()` to restore any hooks that were added by cache drop-ins, which `WP_Hook` correctly supports.

Merge of [38223] with the 4.6 branch.

Props pento, jorbin.
Fixes #36819.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38224 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 01:50:21 +00:00
Aaron Jorbin
f47d932b19 Updates: Improve experience for Bulk Actions when FTP is dismissed.
Merges [38221] to the 4.6 branch.

Before this change, when a bulk update was canceled due dismissing the FTP credentials modal, part of the actions didn't get canceled. This meant the "There is a new version of…” notices become blank and the updates you had checked became unchecked. Now, the notices remain and you are essentially returned to the screen you had before. Strings are also updated to improve ARIA usage.

Fixes #37563.
Props ocean90, swissspidy, obenland, afercia.



git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38222 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 01:15:01 +00:00
Boone Gorges
e74f9a5c30 Improve category check in redirect_canonical() when permastruct contains category slug.
[37262] changed a check in `redirect_canonical()` so that it checked
categories in the object cache rather than querying the database. However,
the check was based on the identity of `WP_Term` objects, which in
certain cases can be augmented by the main WP query routine, causing
failures of the `in_array()` check. This caused unnecessary redirects
for URLs where `is_single()` is true, but the URL is different from the
post permalink, such as the `embed` endpoint.

`has_term()` also checks the cache, but does not sufer from this bug.

Merges [38216] to the 4.6 branch.

Props cmillerdev.
Fixes #36602.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38220 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 00:12:08 +00:00
Dominik Schilling
d3f17e6dbc Taxononmy: Set WP_Term_Query::terms when returning terms from the cache in WP_Term_Query::get_terms().
Merge of [38211] and [38212] to the 4.6 branch.

Props wonderboymusic.
Props boonebgorges for review.
Fixes #37591.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38214 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-08 13:13:56 +00:00
Dominik Schilling
e7d0b4a0fa Update/Install: Replace "error" and "-1" failure messages with a more meaningful one.
* "-1" is an invalid nonce error, show 'An error has occurred. Please reload the page and try again.'.
* "error" means that the connection to the server was lost, show 'Connection lost or the server is busy. Please try again later.'.
* Escape the message in `wp-updates-admin-notice` because the response may include HTML.
* Remove HTML tags in `wp.updates.isValidResponse()` to make PHP's error messages more readable.

Merge of [38205] to the 4.6 branch.

Props azaozz for review.
See #37583.

git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38206 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-05 19:29:31 +00:00
Boone Gorges
97734d0933 In WP_Term_Query, accept a string value for taxonomy.
Merges [38181] to the 4.6 branch.

Props endocreative.
Props ocean90 for review.
Fixes #37545.


git-svn-id: https://develop.svn.wordpress.org/branches/4.6@38182 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-03 13:53:25 +00:00
Dominik Schilling
48078058d7 Script Loader: Ignore deregistered dependencies in wp_dependencies_unique_hosts().
Prevents a PHP warning when a handle of a deregistered dependency is still in the queue.

Fixes #37502.

git-svn-id: https://develop.svn.wordpress.org/trunk@38174 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-31 18:24:21 +00:00
Dominik Schilling
af6b1a5388 Plugins: Move capability checks further up in wp_ajax_update_plugin() and wp_ajax_delete_plugin().
Add tests for both Ajax handlers.

Props Yorick Koster, swissspidy.
Fixes #37490.

git-svn-id: https://develop.svn.wordpress.org/trunk@38168 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 17:42:01 +00:00
Dominik Schilling
24f890045c HTTP API: Normalize cookies before passing them to Requests.
Requests has its own cookie object in form of `Requests_Cookie`. Therefore we have to convert `WP_Http_Cookie` objects to `Requests_Cookie`.
This introduces `WP_Http_Cookie::get_attributes()` to retrieve cookie attributes of a `WP_Http_Cookie` object and `WP_Http::normalize_cookies()` to convert the cookie objects.

Fixes #37437.

git-svn-id: https://develop.svn.wordpress.org/trunk@38164 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 15:31:48 +00:00
Andrew Ozz
52ea1c53ac TinyMCE: upgrade to 4.4.1, changelog: https://www.tinymce.com/docs/changelog/#version441-july262016.
See #37427.
Fixes #37476.

git-svn-id: https://develop.svn.wordpress.org/trunk@38155 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 21:46:36 +00:00
Sergey Biryukov
ccb70aee4b Permalinks: In get_page_uri(), don't prepend a parent page slug if it's empty.
Props inderpreet99, SergeyBiryukov.
Fixes #36174.

git-svn-id: https://develop.svn.wordpress.org/trunk@38145 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 10:04:20 +00:00
Sergey Biryukov
299802bbb5 Unit Tests: Add a @ticket reference for test_get_page_uri_without_argument().
See #26284.

git-svn-id: https://develop.svn.wordpress.org/trunk@38144 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 08:54:23 +00:00
Sergey Biryukov
4f23ce8545 Unit Tests: Move get_page_uri() tests to post/getPageUri.php, added in [37345].
See #26284.

git-svn-id: https://develop.svn.wordpress.org/trunk@38143 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 08:52:52 +00:00
Dominik Schilling
63b7f3da1b Script Loader: Use dns-prefetch for the Emoji CDN.
* `preconnect` will be potentially pretty heavy on the CDN. With the Unicode 9.0 emoji update, almost all browsers will trigger the `preconnect`.
* `preconnect` only opens one connection, but `s.w.org` is HTTP/1.1, so the browser will use the preconnected connection for the first emoji, then it has to open new connections for subsequent emoji.

Also use the same URL as we use for the `emoji_svg_url` filter. This will print the hint for the correct CDN in case someone uses a custom CDN.

Props peterwilsoncc.
Fixes #37387.

git-svn-id: https://develop.svn.wordpress.org/trunk@38122 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 18:18:30 +00:00
Dominik Schilling
44676ab38f Plugins: Improve Ajax search of new plugins.
Fixes a few accessibility issues, restores the "Search Results" tab and the search type selector, and improves compatibility with older browsers.

Props rahulsprajapati, swissspidy, adamsilverstein, ocean90
See #37233.

git-svn-id: https://develop.svn.wordpress.org/trunk@38119 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:31:50 +00:00
Rachel Baker
2cda326902 Tests: Include the check_comment function tests in the comment group.
Adds `@group comment` notation to the `Tests_Comment_CheckComment` class. Introduced in [32519].

Props gma992.
Fixes #37356.

git-svn-id: https://develop.svn.wordpress.org/trunk@38114 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 14:06:44 +00:00
Mike Schroder
ffb2db0521 Media: Clean up prior image edits if IMAGE_EDIT_OVERWRITE is true.
When `IMAGE_EDIT_OVERWRITE` is set to true, edited image files are
supposed to be deleted when an image is restored to the original.

However, when an image was edited more than once, and then restored,
files created during previous edits were left behind.

Fixes this behavior by updating `wp_save_image()` to clean up
leftover images after each edit when `IMAGE_EDIT_OVERWRITE` is true.

Props bradt, chriscct7, joemcgill.
Fixes #32171.

git-svn-id: https://develop.svn.wordpress.org/trunk@38113 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 07:34:54 +00:00
Sergey Biryukov
87376166f2 Multisite: Correct default value for orderby in WP_Network_Query::__construct().
Add a unit test.

See #32504.

git-svn-id: https://develop.svn.wordpress.org/trunk@38102 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 13:09:39 +00:00
Peter Wilson
b92c1c58b3 Script Loader: Limit resource hinting to enqueued assets.
Externally hosted script and style dependencies trigger `dns-prefetch` hinting only when enqueued. This removed a bug in which hinting was added on registration.

Renames the function `wp_resource_hints_scripts_styles` to `wp_dependencies_unique_hosts` as the function provides the hosts, not the hinting.

Props swissspidy.
Fixes #37385.


git-svn-id: https://develop.svn.wordpress.org/trunk@38100 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 02:34:42 +00:00
Boone Gorges
103da159d5 Taxonomy: Improve back compat of values passed to 'terms_clauses' filter.
Prior to the introduction of `WP_Term_Query`, the 'orderby' clause
passed to the 'terms_clauses' filter was prefixed by `ORDER BY`. After
`WP_Term_Query`, this was not the case; `ORDER BY` was added after the
filter. As such, plugins filtering 'terms_clauses' and returning an
'orderby' clause beginning with `ORDER BY` resulted in invalid syntax
when `WP_Term_Query` prepended a second `ORDER BY` keyword to
the clause.

This changeset rearranges the way the 'orderby' clause is built so that
it will be passed to 'terms_clauses' in the previous format.

Fixes #37378.

git-svn-id: https://develop.svn.wordpress.org/trunk@38099 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 02:12:48 +00:00