Home Forums Backend Issues (wp-admin) Conditional Logic not working?


Conditional Logic not working?

  • When trying to create conditioanl logic for a field it doesnt work.

    After clicking “Yes” on the Conditional Logic it just says “or <Add rule group>”. Click “Add rule group” does nothing. If i have conditional logic checked, I get the following error message:

    Warning: Invalid argument supplied for foreach() in /the/path/is/strong/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php on line 732
    Warning: Cannot modify header information - headers already sent by (output started at /the/path/is/strong/wp-content/plugins/advanced-custom-fields-pro/api/api-field.php:732) in /the/path/is/strong/wp-includes/pluggable.php on line 1121
  • i have the same issue 🙁

  • Was about to also post about exact same issue as I make heavy use of it. Trying to finalise back end UI which currently has exploded into a total mess 🙁

  • Same issue, behaviour as reported by smartmediaas above. ACF Pro 5.0.1, no other plugins installed. Fresh WP 3.9.1 install on MAMP.

  • 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 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.