I'm trying to create a filter so we can remove fields from a metabox.
This is the function that I have created to it. It returns null as aspected, but the field is still there in the metabox.
Code:
/**
* filter fields
*/
public function syb_filter_fields( $fields ) {
foreach ( $fields as $field ) {
if ( $field['id'] == 'boat-details' ) {
foreach ($field['fields'] as $key => $value) {
if ( $value["id"] == 'field-id' ) {
$value = NULL;
}
}
}
}
return $fields;
}