#32363 closed enhancement (fixed)
Filter in `wp_get_attachment_image_src`
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.3 | Priority: | normal |
| Severity: | normal | Version: | 2.5 |
| Component: | Media | Keywords: | has-patch dev-feedback |
| Focuses: | Cc: |
Description
I’ve been working on a plugin for filler images on posts without thumbnails so that during development I’m not swamping the media library with things I have to delete later.
I can hook into post_thumbnail_html and check if the HTML is empty, which does the trick for things like get_post_thumbnail(), but sometimes I may use the post thumbnail as a background image, so I use wp_get_attachment_image_src instead, which doesn't call the aforementioned hook. It’d be nice to be able to hook in there as well. Other suggestions would be great, but I'll be working on a patch.
Attachments (6)
Change History (22)
This ticket was mentioned in Slack in #core by eclev91. View the logs.
11 years ago
#5
@
11 years ago
- Component changed from General to Media
- Keywords needs-docs needs-testing added
- Milestone changed from Awaiting Review to 4.3
- Version changed from trunk to 2.5
This'll need a hook docblock and probably a better name for the filter. attachment_image_src is probably most appropriate.
#7
@
11 years ago
- Owner set to johnbillion
- Status changed from new to assigned
@johnbillion, do you have time to get it in before beta?
#10
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Since we're filtering the actual return of wp_get_attachment_image_src(), I think we should name the filter the same thing. In 32363.diff I've adjusted the name and fixed the spacing within the DocBlock.
#11
@
11 years ago
- Keywords dev-feedback added
I don't think the filter name needs to be tied to the function name. The filter is for the attachment image source, so attachment_image_src makes sense.
Doc changes look good.
#13
@
11 years ago
- Owner changed from wonderboymusic to DrewAPicture
- Status changed from reopened to assigned
The only thing left is (potential) name change of the filter. Up to you.
Run filter on return no matter what