Home › Forums › ACF PRO › Displaying custom field on all attached media items › Reply To: Displaying custom field on all attached media items
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.