Home › Forums › ACF PRO › Picking data from a custom field of another CPT › Reply To: Picking data from a custom field of another CPT
When you are showing the “Dish” and listing the “Restaurant” you can get and show the address from the restaurant, you just need to supply the restaurant post ID when you call get the field.
// assumes that the post object field on "Dish" returns "Post Object"
$restaurant = get_field('restaurant');
$address = get_field('address', => $restaurant->ID);
https://www.advancedcustomfields.com/resources/how-to-get-values-from-another-post/
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.