Skip to content

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

Auto-generated Example

add_filter(
   'field_id',
    function(
        null|bool $delete,
        array $args,
        array $field_args,
        CMB2_Field object
    ) {
        // Your code here.
        return $delete;
    },
    10,
    4
);

Parameters

  • null|bool $delete Whether to allow metadata deletion of the given type.
  • array $args Array of data about current field including:
  • array $field_args All field arguments
  • CMB2_Field object $field This field object

Files

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 )

← All Hooks

Clone this wiki locally