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:
Name | Description |
---|---|
$value | The value returned by the rwmb_meta function |
$field_id | The field ID |
$args | Arguments passed to the rwmb_meta function |
$object_id | Object 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 );