Pass relationship field to other shortcode
-
Hello Eliot,
I’m trying to pass the value of a relationship field to an other shortcode, but it doesn’t work. I hope you can help me.
I have a (ACF) relationship field for posts where I can select related events (cpt from the all-in-one event calendar plugin). The “return format” is set to “Post IDs”.
I want to use it like this, but it doesn’t work:
[pass field=related_events] [ai1ec post_id="{FIELD}"] [/pass]
When I add one event to the field and use
[field related_events]
, it returns the post id of the event, for example1978
. When I add more then one event, it returns1978, 1979
. That’s fine!But when I pass the field value like this, it returns
(Array)
:[pass field=related_events] {FIELD} [/pass]
I also tried to use the
[pass array=related_events]
, but I don’t think that’s the solution, because the field doesn’t have different array keys (?). And I don’t know what you mean with “If the array is a series of values, use the index as key”.Do you know what I have to change to make it work?
Thank you in advance!
Peter
- The topic ‘Pass relationship field to other shortcode’ is closed to new replies.