| @@ 112-152 (lines=41) @@ | ||
| 109 | ||
| 110 | ||
| 111 | // disabled |
|
| 112 | if( !empty($logic['status']) ) { |
|
| 113 | ||
| 114 | // reset |
|
| 115 | $field['conditional_logic'] = array(); |
|
| 116 | ||
| 117 | ||
| 118 | // vars |
|
| 119 | $group = 0; |
|
| 120 | $all_or_any = $logic['allorany']; |
|
| 121 | ||
| 122 | ||
| 123 | // loop over rules |
|
| 124 | if( !empty($logic['rules']) ) { |
|
| 125 | ||
| 126 | foreach( $logic['rules'] as $rule ) { |
|
| 127 | ||
| 128 | // sperate groups? |
|
| 129 | if( $all_or_any == 'any' ) { |
|
| 130 | ||
| 131 | $group++; |
|
| 132 | ||
| 133 | } |
|
| 134 | ||
| 135 | ||
| 136 | // add to group |
|
| 137 | $field['conditional_logic'][ $group ][] = $rule; |
|
| 138 | ||
| 139 | } |
|
| 140 | ||
| 141 | } |
|
| 142 | ||
| 143 | ||
| 144 | // reset keys |
|
| 145 | $field['conditional_logic'] = array_values($field['conditional_logic']); |
|
| 146 | ||
| 147 | ||
| 148 | } else { |
|
| 149 | ||
| 150 | $field['conditional_logic'] = 0; |
|
| 151 | ||
| 152 | } |
|
| 153 | ||
| 154 | } |
|
| 155 | ||
| @@ 427-466 (lines=40) @@ | ||
| 424 | ||
| 425 | ||
| 426 | // location rules changed to groups (v5.0.0) |
|
| 427 | if( !empty($field_group['location']['rules']) ) { |
|
| 428 | ||
| 429 | // extract location |
|
| 430 | $location = acf_extract_var( $field_group, 'location' ); |
|
| 431 | ||
| 432 | ||
| 433 | // reset location |
|
| 434 | $field_group['location'] = array(); |
|
| 435 | ||
| 436 | ||
| 437 | // vars |
|
| 438 | $group = 0; |
|
| 439 | $all_or_any = $location['allorany']; |
|
| 440 | ||
| 441 | ||
| 442 | // loop over rules |
|
| 443 | if( !empty($location['rules']) ) { |
|
| 444 | ||
| 445 | foreach( $location['rules'] as $rule ) { |
|
| 446 | ||
| 447 | // sperate groups? |
|
| 448 | if( $all_or_any == 'any' ) { |
|
| 449 | ||
| 450 | $group++; |
|
| 451 | ||
| 452 | } |
|
| 453 | ||
| 454 | ||
| 455 | // add to group |
|
| 456 | $field_group['location'][ $group ][] = $rule; |
|
| 457 | ||
| 458 | } |
|
| 459 | ||
| 460 | } |
|
| 461 | ||
| 462 | ||
| 463 | // reset keys |
|
| 464 | $field_group['location'] = array_values($field_group['location']); |
|
| 465 | ||
| 466 | } |
|
| 467 | ||
| 468 | ||
| 469 | // some location rules have changed (v5.0.0) |
|