Home › Forums › General Issues › How to set default value for custom field from theme › Reply To: How to set default value for custom field from theme
So your field group is either created in a plugin or somewhere in the theme. You can either modify the theme or you can add a filter to set the default value. I would go with the filter, you can add this to your functions.php file.
I can tell by looking at this that it’s either a repeater field or a flexible content field and you’re going to need the field key in order to add the filter so you’ll need to find where the fields are created to get the field key.
What version of ACF is being used? You’ll need to search for where the fields are created and that may be a bit different depending on the ACF version.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.