[wp-trac] [WordPress Trac] #57760: add 'pre_wp_get_attachment_url' filter

WordPress Trac noreply at wordpress.org
Thu May 4 14:35:02 UTC 2023


#57760: add 'pre_wp_get_attachment_url' filter
-------------------------+------------------------------
 Reporter:  fodisery     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------
Changes (by sabernhardt):

 * component:  General => Media


Old description:

> We are making plugin for featured image using external url.
>
> If user gt featured image url via wp_get_attachment_url() there is no way
> for us to hook because 'wp_get_attachment_url' hook will never called if
> the post is not 'attachment'. The only way for us to make it work via
> creating fake attachment which is complicated.
>
> 'pre_wp_get_attachment_url' filter will be very helpful in this case.

New description:

 We are making plugin for featured image using external url.

 If user gt featured image url via `wp_get_attachment_url()` there is no
 way for us to hook because `wp_get_attachment_url` hook will never called
 if the post is not 'attachment'. The only way for us to make it work via
 creating fake attachment which is complicated.

 `pre_wp_get_attachment_url` filter will be very helpful in this case.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57760#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list