Home › Forums › ACF PRO › Displaying custom field on all attached media items › Reply To: Displaying custom field on all attached media items
Hi @aswhipple
I think you can use the the_content filter and try to find the attachment URL. After that, you need to convert this URL to the attachment ID. Here’s an example how to do that: http://wordpress.stackexchange.com/questions/6645/turn-a-url-into-an-attachment-post-id.
After you got the attachment ID, you can use the get_field() or the_field() function and replace the image by using the preg_replace() function.
I’m afraid I can’t give you more details as it needs an advanced code. I’m sorry about that.
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.