Skip to main content

rwmb_meta

This filter is used to change the returned value of the rwmb_meta() helper function .

apply_filters( 'rwmb_meta', $value, $field_id, $args, $object_id );

It accepts 4 parameters:

NameDescription
$valueThe value returned by the rwmb_meta function
$field_idThe field ID
$argsArguments passed to the rwmb_meta function
$object_idObject ID

Examples

Format the value of a date field:

add_filter( 'rwmb_meta', function( $value, $field_id, $args, $object_id ) {
if ( $field_id === 'event_date' ) {
$value = date( 'F j, Y', strtotime( $value ) );
}
return $value;
}, 10, 4 );