Home › Forums › General Issues › acf/load_value php error › Reply To: acf/load_value php error
You cannot alter the default value of a field in the load value filter. You can only alter the value.
Explanation: When using filters in WP only the first argument passed to the filter can be returned and it needs to be the correct format for that argument that the calling function expects. In this case $value is likely a string value and you are attempting to return a field object (array) and this is likely the cause of your error.
Try using an acf/prepare_field filter instead if you want to alter the field’s default value.
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.