Make WordPress Core

Opened 16 months ago

Last modified 14 months ago

#57760 new enhancement

add 'pre_wp_get_attachment_url' filter

Reported by: fodisery's profile fodisery Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:

Description (last modified by sabernhardt)

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.

Change History (3)

#1 @fodisery
16 months ago

Real life problem:
They solve this by creating fake attachment for each featured image, which waste of space.
They stated plugin wont work if theme uses 'wp_get_attachment_url' to get featured image url

#2 @fodisery
16 months ago

even jetpack also have problem hooking photon to wp_get_attachment_url()

#3 @sabernhardt
14 months ago

  • Component changed from General to Media
  • Description modified (diff)
Note: See TracTickets for help on using tickets.