Home › Forums › Backend Issues (wp-admin) › Conditional Logic not working? › Reply To: Conditional Logic not working?
I hacked api-field.php with the following snippet to stop the stack trace and allow me to access the back end again until the update with the fix is released.
It just checks to see if $groups in an array, in this case the value for conditional_logic was an int. The error happened because the code was trying to do a foreach() on the non array.
if ( is_array ( $groups) ) {
// remove empty rules
foreach( $groups as $group ) {
if( !empty($group) ) {
$field['conditional_logic'][] = $group;
}
}
} else {
$field['conditional_logic'][] = $group;
}
I am sure this is not a fix, rather just a band-aid to stop the bleeding. It does give me access to wp-admin again 🙂
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.