Opened 7 years ago
Last modified 5 years ago
#42549 assigned enhancement
Widgets: Allow gallery widget to display images from currently-queried singular post if no images selected
Reported by: | westonruter | Owned by: | audrasjb |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Widgets | Keywords: | has-patch has-screenshots needs-unit-tests |
Focuses: | Cc: |
Description
In #42548 (pending) a [gallery]
placed inside of a Text widget will result in the attachments for a given post to be used in the gallery when the widget appears on a singular template. The same behavior could be allowed for the Gallery widget as well. If you add a gallery widget to a sidebar but don't add any images to it, the widget could conditionally show if it is being rendered on a singular template for a post that has image attachments.
Attachments (3)
Change History (17)
#5
@
6 years ago
- Keywords 2nd-opinion removed
- Milestone changed from Future Release to 5.2
Let's address this feature in 5.2
#6
@
6 years ago
- Keywords needs-testing added
Going to punt this since 5.2 beta 1 is in less than 2 days. @audrasjb if you are able to get this ready by beta, feel free to move it back.
#7
@
6 years ago
- Milestone changed from 5.2 to 5.3
The timeframe is too short to have testing on this on, so I'm inclined to punt the ticket to 5.3.
#9
@
5 years ago
- Keywords needs-screenshots needs-refresh added
Needs refresh and coding standards changes.
#10
@
5 years ago
- Keywords has-screenshots commit added; needs-testing needs-screenshots needs-refresh removed
Hi there,
I refreshed the initial patch and I fixed some coding standards issues.
42549.1.diff
looks good to go on my side (see screenshot above). On singular posts that have attached media images, the widget fallback displays those images. On any other pages (archives, posts without attached images, etc.) the widget is not displayed.
Cheers,
Jb
#11
@
5 years ago
- Keywords needs-unit-tests added; commit removed
@audrasjb Thanks for working on this one!
The patch itself looks good. It wouldn't hurt to get some unit tests, though.
Also, the concern stated in ticket:42549#comment:1 still exists. Wondering if there should be a clear button there to make this easier.
#12
@
5 years ago
- Milestone changed from 5.3 to 5.4
With 5.3 beta 1 in a few hours, I'm going to punt this one.
There may need to be a way to clear a gallery of its selected images. Currently once you select an image, you cannot reset the gallery to be empty without deleting the gallery widget and adding one in its place.