Opened 12 years ago
Closed 9 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: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | 3.9.2 |
| Severity: | normal | Keywords: | has-patch dev-feedback needs-testing |
| Cc: | Focuses: |
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
@
10 years ago
Why not extend this to the WP_Query. The gallery shortcode uses the post__in parameter.
It's not that difficult to allow a range for this parameter, the parser can convert it to a range of ID's before building the query itself.
#3
@
10 years ago
- Component Gallery → Query
- Keywords has-patch dev-feedback needs-testing added; needs-patch removed
- Summary Media IDs in gallery shortcode : allow ranges of ids → Allow a range of ID's for WP_Query : (prev: Media IDs in gallery shortcode - allow ranges of ids)
#4
@
9 years ago
- Milestone Awaiting Review
- Resolution → wontfix
- Status new → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Personally not a fan of this, but it probably wouldn't be hard to support.