[wp-trac] [WordPress Trac] #23873: Gallery shortcode orderby does not support multiple column sorting
WordPress Trac
noreply at wordpress.org
Tue Oct 28 20:42:22 UTC 2014
#23873: Gallery shortcode orderby does not support multiple column sorting
-------------------------------------+-----------------------------
Reporter: dglingren | Owner: wonderboymusic
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.1
Component: Gallery | Version: 3.5.1
Severity: normal | Resolution: fixed
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+-----------------------------
Changes (by wonderboymusic):
* owner: => wonderboymusic
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"30068"]:
{{{
#!CommitTicketReference repository="" revision="30068"
The `gallery` shortcode used to accept a SQL chunk for the value of the
`orderby` attribute. The reason? `get_posts()` used to be called in the
shortcode handler with a query-string blob of arguments passed to it. To
mitigate breakage, `sanitize_sql_orderby()` was created in [7592].
`sanitize_sql_orderby()` expects a comma to be present when multiple
`orderby` values were passed. The correct syntax for multiple fields is
space-delimited. Since [29027], comma-separated values would never be
parsed correctly when passed to `WP_Query->parse_orderby()`.
`sanitize_sql_orderby()` is used nowhere else in core, save for the
`playlist` shortcode - I only added it there because I was mimic'ing the
`gallery` logic. The function call can be removed from both shortcode
handlers.
See #6476.
Fixes #23873.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23873#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list