Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreiglingeanu/4d23ba7e821ab9c82dd899a3426177ce to your computer and use it in GitHub Desktop.
Save andreiglingeanu/4d23ba7e821ab9c82dd899a3426177ce to your computer and use it in GitHub Desktop.
<?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