Home › Forums › General Issues › ACF and Widgets › Reply To: ACF and Widgets
This is a great feature! I don’t understand how to retrieve the saved values and display them on the front-end. I tried get_field in the widget function of the widget class but that doesn’t work. Anyone has an idea how to retrieve the acf data saved to widgets?
EDIT:
Well, I think I found a solution. This is how I did it in the widget function of the widget class:
$test_value = get_field('test', 'widget_' . $args['widget_id']);
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.