Opened 10 years ago
Closed 7 years ago
#29291 closed enhancement (wontfix)
Allow a range of ID's for WP_Query : (prev: Media IDs in gallery shortcode - allow ranges of ids)
Reported by: | grosbouff | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9.2 |
Component: | Query | Keywords: | has-patch dev-feedback needs-testing |
Focuses: | Cc: |
Description
Hi,
I have a lot of galleries with a lot of images in it.
Usually, media IDs are in order, So I have something like this for shortcode :
[gallery ids="266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,306,307,308,309,310"]
It would be nice being able to use id ranges, like :
[gallery ids="266-298,306-310"]
(like printer drivers do !)
Attachments (1)
Change History (5)
#2
@
8 years ago
Why not extend this to the WP_Query. The gallery shortcode uses the post__in
and include
parameters.
It's not that difficult to allow a range for this parameter, the parser can convert it to an array of ID's before building the query itself.
#3
@
8 years ago
- Component changed from Gallery to Query
- Keywords has-patch dev-feedback needs-testing added; needs-patch removed
- Summary changed from Media IDs in gallery shortcode : allow ranges of ids to Allow a range of ID's for WP_Query : (prev: Media IDs in gallery shortcode - allow ranges of ids)
#4
@
7 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
I understand that the ergonomics of typing these IDs is bad, but they should not be typed: they should be generated by the media modal. The problem with a range is that it requires filtering the results, because none of the properties for IDs requested is known ahead of time.
Personally not a fan of this, but it probably wouldn't be hard to support.