#18178 closed enhancement (fixed)
Add "none" option to $attr['link'] for [gallery] shortcode
Reported by: | chipbennett | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 3.2.1 |
Component: | Gallery | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
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 (5)
Change History (19)
#3
@
12 years ago
+1 Need it for the next version of my photography site, where I use the gallery shortcode to display full size images.
#5
@
12 years ago
- Cc helgatheviking@… added
Is there anything I can do to get Chip's patch moved along towards core?
#6
@
12 years 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.
#8
@
12 years 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
#9
@
12 years ago
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.
#11
@
12 years ago
18178.2.diff cleans up the code a bit more and updates to apply cleanly.
Add
link="none"
support to[gallery]
shortcode, to enable output of flat/unlinked images