Home › Forums › General Issues › Retrieving image url through relationship › Reply To: Retrieving image url through relationship
I learn something new every day. I wanted to be sure I was not going crazy. This is something that I did not know until today. The WP_Post class has a magic __get() method that will return unknown properties.
However, in this case it is only returning the value for the image field that is stored in the database as a string. This bypasses the ACF by using get_post_meta() and this is why you are getting a string ID value instead of the value you expect.
Thank you for the enlightening topic. I like learning new things even after doing this for so many years.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.