Skip to content

cmb2_field_defaults

github-actions[bot] edited this page Jun 25, 2026 · 1 revision

Filter the CMB2 Field defaults.

Auto-generated Example

add_filter(
   'cmb2_field_defaults',
    function(
        array $defaults,
        string $id,
        string $type,
        CMB2_Field object
    ) {
        // Your code here.
        return $defaults;
    },
    10,
    4
);

Parameters

  • array $defaults Metabox field config array defaults.
  • string $id Field id for the current field to allow for selective filtering.
  • string $type Field type for the current field to allow for selective filtering.
  • CMB2_Field object $field This field object.

Files

apply_filters( 'cmb2_field_defaults', $defaults, $args['id'], $args['type'], $this )

← All Hooks

Clone this wiki locally