-
Notifications
You must be signed in to change notification settings - Fork 4
cmb2_override_meta_value
github-actions[bot] edited this page Jun 25, 2026
·
1 revision
Filter whether to override getting of meta value. Returning a non 'cmb2_field_no_override_val' value will effectively short-circuit the value retrieval.
return - a single metadata value, or an array of values.
add_filter(
'cmb2_override_meta_value',
function(
mixed $value,
int $object_id,
array $args,
CMB2_Field object
) {
// Your code here.
return $value;
},
10,
4
);-
mixed$valueThe value get_metadata() should -
int$object_idObject ID. -
array$args -
CMB2_Fieldobject$field This field object-
string$typeThe current object type -
int$idThe current object ID -
string$field_idThe ID of the field being requested -
bool$repeatWhether current field is repeatable -
bool$singleWhether current field is a single database row
-
apply_filters( 'cmb2_override_meta_value', 'cmb2_field_no_override_val', $this->object_id, $a, $this )add_action(
'cmb2_footer_enqueue',
function() {
// Your code here.
}
);do_action( 'cmb2_footer_enqueue' )