#19181 closed enhancement (worksforme)
Make image_link_input_fields filterable to add buttons
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.7 |
| Component: | Media | Keywords: | |
| Focuses: | Cc: |
Description
This patch makes the image_link_input_fields function filterable, so that additional buttons could be added to the Link URL section when inserting an image into a post.
In my case, I want to be able to link an image to the post it belongs to. It's a weird/tiny use case, but this filter will let me use a plugin to add it myself.
Attachments (3)
Change History (11)
#2
@
15 years ago
Rather than a general filter on HTML output, we may wish to make an associative array of the type=button's, then filter that, then echo it.
Should be noted the patch is stale thanks to #13544. Seriously. ;)
#3
@
14 years ago
Figured I would revisit this ticket and idea. Attaching a refreshed patch with the array of buttons filtered. How's it look?
#4
@
14 years ago
Could probably just return that HTML input concatenated with the imploded content of the array and maintain the new lines, rather than storing in the $output variable without them. I'm sure someone else will correct me if that's not the usual style, though :)
#6
@
12 years ago
- Keywords has-patch removed
At this point the media iframe is deprecated (in spirit if not officially) in lieu of 3.5's media modal.
In the new media experience, users can select "Custom URL" in the "Link to" dropdown, so that solves your use case @ryanimel, perhaps in a rough around the edges sort of way.
Closing out.
#8
@
12 years ago
- Milestone Awaiting Review deleted
This patch makes the image_link_input_fields function filterable, so that additional buttons could be added to the Link URL section when inserting an image into a post.
You could actually add buttons to the old media modal using attachment_fields_to_edit filter, see an example plugin on #21114: add-link-to-large-image.php:ticket:21114.
If it helps, this is the kind of plugin I have in mind to use once this patch is introduced: http://cl.ly/2s392s1v2B2Y051A1h1x