Shortcode to Display Advanced Custom Fields (ACF) Select Field Value in HTML Object

20 August, 2024 04:52:37
kaya.murer
Topics: 3
Messages: 8
I want do display the value from the acf custom select field "my-field" in an html object.

I am using the following markup but on the generated pdf i get the word "Array" instead of the selected values from the acf select field.
[acf field="my-field" post_id="[id]"]

I don’t know if this matters but i am using an empty html object where i add content pieces with if conditions via actions.
Is there any documentation on how to include the different acf field types in e2pdf?

Thanks a lot!
20 August, 2024 04:54:21
E2Pdf
Support
Topics: 7
Messages: 3330
Hello,

Can you please let us know:

1. What is the field type of the "my-field"?
2. Which ACF version do you use?
We would really appreciate your feedback at WordPress.org!
20 August, 2024 04:57:04
kaya.murer
Topics: 3
Messages: 8
Hello,

Thank you for your really fast reply.

1. "my-field" is a select type
2. Currently installed is ACF Pro 6.3.4
20 August, 2024 04:59:06
E2Pdf
Support
Topics: 7
Messages: 3330
Can you please update the ACF to 6.3.5, due 6.3.4 has issues with outputting some values correctly via shortcodes and the issue seems connected with it.

https://www.advancedcustomfields.com/blog/acf-6-3-5/

* Fix – The ACF Shortcode now correctly outputs a comma separated list of values for arrays
We would really appreciate your feedback at WordPress.org!
20 August, 2024 05:04:22
kaya.murer
Topics: 3
Messages: 8
Oh wow great!
Did the update and everything is working like a charm now.

Thank you a lot for this outstanding fast support.

Wish you a nice day.