Created
December 8, 2023 15:49
-
-
Save andreiglingeanu/4d23ba7e821ab9c82dd899a3426177ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'blocksy:pro:post-types-extra:acf:collect-fields', | |
function ($fields, $all_fields) { | |
$fields_to_allow = ['image']; | |
$result = []; | |
foreach ($all_fields as $single_field) { | |
if ( | |
in_array($single_field['name'], $fields_to_allow) | |
|| | |
isset($fields[$single_field['name']]) | |
) { | |
$result[$single_field['name']] = $single_field['label']; | |
} | |
} | |
return $result; | |
}, | |
10, | |
2 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment