- This topic has 1 reply, 2 voices, and was last updated 1 year, 7 months ago by .
-
Topic
-
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; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.