Go to file
Boone Gorges 082c5d1534 Query: Standardize treatment of 'orderby' values post__in, post_parent__in, and post_name__in.
Ordering by `post__in` was introduced in [21776], but the code assumed that
`post__in` would be a comma-separated string listing post IDs. When an array
of post IDs was passed to the `post__in` query var, 'orderby=post__in' was
not respected. This changeset changes this behavior by handling
'orderby=post__in' in the same way as most other values of 'orderby',
which ensures that arrays as well as strings can be properly parsed.

The same treatment is given to the similar `post_name__in` and
`post_parent__in` options of 'orderby', so that most query generation for
orderby clauses happens in the same place, instead of in special cases.

A slight change in the resulting SQL (related to the whitespace around
parentheses and commas) necessitates a change to an existing REST API test
that does a string comparison against the SQL query.

Props mgibbs189, kelvink.
Fixes #38034.

git-svn-id: https://develop.svn.wordpress.org/trunk@44452 602fd350-edb4-49c9-b593-d223f7449a82
2019-01-08 03:32:04 +00:00
src Query: Standardize treatment of 'orderby' values post__in, post_parent__in, and post_name__in. 2019-01-08 03:32:04 +00:00
tests Query: Standardize treatment of 'orderby' values post__in, post_parent__in, and post_name__in. 2019-01-08 03:32:04 +00:00
tools Build tools: Allow building WordPress to src. 2018-12-24 13:28:22 +00:00
.editorconfig General: Instruct file editors not to trim trailing whitespace in markdown files. 2018-03-20 22:14:53 +00:00
.gitignore Build Tools: After [44359], add src/wp-admin/js to .gitignore. 2018-12-28 13:52:12 +00:00
.jshintrc Build tools: Fix the travis:js build. 2018-12-24 13:53:11 +00:00
.npmrc Once upon a midnight dreary, while I coded, weak and weary, 2018-05-23 10:04:22 +00:00
.nvmrc Once upon a midnight dreary, while I coded, weak and weary, 2018-05-23 10:04:22 +00:00
.travis.yml Build Tools: Switch to Node 10.13.0. 2018-12-16 01:42:24 +00:00
composer.json Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
composer.lock Coding Standards: Upgrade WPCS to 1.0.0 2018-08-17 01:50:26 +00:00
Gruntfile.js Build tools: Fix the travis:js build. 2018-12-24 13:53:11 +00:00
jsdoc.conf.json Build Tools: Fix JSDoc configuration include paths. 2018-06-14 12:45:06 +00:00
package-lock.json Block Editor: Upgrade @WordPress packages to the latest versions. 2019-01-04 19:37:30 +00:00
package.json Block Editor: Upgrade @WordPress packages to the latest versions. 2019-01-04 19:37:30 +00:00
phpcs.xml.dist Multisite: Fix coding standard errors after [43654]. 2018-09-24 15:22:01 +00:00
phpunit.xml.dist REST API: Introduce Autosaves controller and endpoint. 2018-12-13 22:41:47 +00:00
webpack.config.js Build tools: Allow building WordPress to src. 2018-12-24 13:28:22 +00:00
wp-cli.yml Tools: Update wp-cli.yml to point to the build directory. 2018-05-25 00:14:14 +00:00
wp-config-sample.php Code is Poetry. 2017-11-30 23:09:33 +00:00
wp-tests-config-sample.php Build/Test Tools: Roses are red, this fixes stuff. 2018-05-23 17:54:44 +00:00