Skip to content

Commit

Permalink
fix: corrected private acf fields accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin committed Jan 17, 2025
1 parent 2ad5f67 commit 2413458
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions library/Admin/Private/PrivateAcfFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ public function conditionallyShowBasedOnStatus($field)
$field['conditional_logic'] = [];
}

$field['conditional_logic'][] =
[
[
'field' => $this->hiddenInputKey,
'operator' => '==',
'value' => 'private'
]
];
$conditional = [
'field' => $this->hiddenInputKey,
'operator' => '==',
'value' => 'private'
];

if (!empty($field['conditional_logic'])) {
foreach ($field['conditional_logic'] as &$logicGroup) {
$logicGroup[] = $conditional;
}
} else {
$field['conditional_logic'][] = [$conditional];
}

return $field;
}
Expand Down

0 comments on commit 2413458

Please sign in to comment.