Opened 22 months ago
Last modified 6 weeks ago
#18178 new enhancement
Add "none" option to $attr['link'] for [gallery] shortcode
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.6 |
| Component: | Gallery | Version: | 3.2.1 |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | MHagemeister, helgatheviking@…, marcel@… |
Description
Currently, the [gallery] shortcode only supports output of linked images. By default, each gallery image links to the attachment page, or directly to the file, if link="file" is passed to the shortcode. Both cases use wp_get_attachment_image_link().
Attached patch adds support for link="none", enabling the gallery images to be output as flat image files, rather than linked, via wp_get_attachment_image().
Attachments (4)
Change History (14)
chipbennett — 22 months ago
comment:1
chipbennett — 22 months ago
- Keywords has-patch needs-testing added
comment:2
helgatheviking — 11 months ago
+1 for this feature. is this going to be integrated at some point?
comment:3
MHagemeister — 4 months ago
+1 Need it for the next version my photography site, where I use the gallery shortcode to display full size images.
comment:4
MHagemeister — 4 months ago
- Cc MHagemeister added
comment:5
helgatheviking — 3 months ago
- Cc helgatheviking@… added
Is there anything I can do to get Chip's patch moved along towards core?
comment:6
helgatheviking — 3 months ago
Just to verify that Chip's patch still works perfectly over a year later. I got some error about line numbers not matching up any more (I use git) and so I just created a new version of the same diff.... don't know if it is needed or not. Ultimately, Chip's approach works great and I think would be worth including in the next update.
comment:7
chipbennett — 3 months ago
I'll refresh the patch - probably tonight.
wonderboymusic — 3 months ago
comment:8
wonderboymusic — 3 months ago
- Milestone changed from Awaiting Review to 3.6
This seems harmless - I tidy'd up the code a lil bit, but it's all based on your patches. wp_get_attachement_* funcs are documented themselves, so I don't think we need to go into great detail about what is going down here
Please let's not forget that galleries in feeds are handled by a slightly different code path and may also need some attention. See #22101.
comment:10
macbrink — 6 weeks ago
- Cc marcel@… added

Add link="none" support to [gallery] shortcode, to enable output of flat/unlinked images