Get relationship value from ACF Relationship field

Scheduled
23 March, 2020 16:22:50
rizqon
Topics: 2
Messages: 2
Hi!
thanks guys for a great plugin, but I have a little problem here. How to get a relationship value from ACF Relationship field where it is returned post object of relation post type
24 March, 2020 01:59:51
E2Pdf
Support
Topics: 7
Messages: 3188
Hi,

Unfortunately there is no built-in feature with which it's possible to pull out full data from relationship field where it is returned post object. You can get only the related post IDs.

We moved your thread to "Feature Requests" section and checking the possibility to add this functionality.

Meanwhile, if you have knowledge of PHP you can try to use "filter" to update output value.

- Example which must be added to functions.php: https://codeshare.io/5QBgKq

- Example of Field setup and values that used in PHP example is attached as screenshot.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
18 December, 2022 19:43:47
whynotadv
Topics: 1
Messages: 5
In the PHP example do I add my relationship field names in place of "post_content" in both spots in the filter code?

Also in e2PDF when editing the Properties, do I type the name of the actual relationship field in the [meta key="relationship" path="0"]????????

Can you please share example PHP code and shortcode that references "home_listings_community" as the ACF relationship field?

I'm confused how to get it to work. My clients site has a custom post type of "home listings" and I want to automatically generate a PDF for each home listing and each home listings has a "Community" relationship. Each home listing PDF will have a unique community name and logo associated with it. I really need help with figuring out how to get that to display.

Thanks!