In order to get custom fields for widgets using a shortcode you’d need to specify the correct post id. In this case is would be something like
widget_' . $widget_id), so you’d need to include the id in the shortcode.
See the shortcodes doc here http://www.advancedcustomfields.com/resources/shortcode/ and document on getting values from fields attached to shortcodes here http://www.advancedcustomfields.com/resources/get-values-widget/.
I don’t know how you’d know what the actual ID of the widget it when editing the widget and this is only a guess. If I save the widget and then inspect the code it has an id that looks something like this
widget-14. I suspect, but would have to test, that the ID value of the widget that I’d need to use for ACF is
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!
© 2022 Advanced Custom Fields.