Home › Forums › ACF PRO › WYWIWYG Widget Block/Background Image Field › Reply To: WYWIWYG Widget Block/Background Image Field
This is just a guess, so I’m not sure if it will do you any good. Basically you need to alter the widget arguments for ‘before_widget’ and ‘after_widget’ based on the custom field. Like most widgets, where are no hooks in the widget itself to make these changes https://plugins.svn.wordpress.org/wysiwyg-widgets/trunk/includes/class-widget.php.
The closest I’ve been able to find is this WP hook https://developer.wordpress.org/reference/hooks/dynamic_sidebar_params/. From looking at it I’m guessing that $params contains information on all of the widgets that are in the sidebar, but again, this is just a guess. If the guess is correct you could loop through all of the widgets, find the right ones, get your custom field value and then modify the before and after widget arguments to include your container div with the background image.
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.