-
Notifications
You must be signed in to change notification settings - Fork 4
field_id
github-actions[bot] edited this page Jun 25, 2026
·
1 revision
Filter whether to override removing of meta value.
The dynamic portion of the hook, $a['field_id'], refers to the current field id paramater. Returning a non-null value will effectively short-circuit the function.
'type' : Current object type 'id' : Current object ID 'field_id' : Current Field ID 'repeat' : Whether current field is repeatable 'single' : Whether to save as a single meta value
add_filter(
'field_id',
function(
null|bool $delete,
array $args,
array $field_args,
CMB2_Field object
) {
// Your code here.
return $delete;
},
10,
4
);-
null|bool$deleteWhether to allow metadata deletion of the given type. -
array$argsArray of data about current field including: -
array$field_argsAll field arguments -
CMB2_Fieldobject$field This field object
apply_filters( "cmb2_override_{$a['field_id']}_meta_value", $data, $this->object_id, $a, $this )apply_filters( "cmb2_override_{$a['field_id']}_meta_save", $override, $a, $this->args(), $this )apply_filters( "cmb2_override_{$a['field_id']}_meta_remove", $override, $a, $this->args(), $this )add_action(
'cmb2_footer_enqueue',
function() {
// Your code here.
}
);do_action( 'cmb2_footer_enqueue' )