Support General How to filter value of spesific field before saving it to DB Reply To: How to filter value of spesific field before saving it to DB

#9354
foundbutlostfoundbutlost
Participant

I tried this after found this thread https://support.metabox.io/topic/woocommerce-prdoucts-image-gallery-with-metabox-image-fields/#post-7904


add_filter( 'rwmb_meta_boxes', 'my_meta2_box' );
function my_meta2_box( $meta_boxes ) {
    $meta_boxes[] = array (
      'title' => 'Meta song',
      'table' => 'wp_xxxx',
      'storage_type' => 'custom_table',
      'post_types' =>   array (
         'post',
      ),
      'context' => 'form_top',
      'priority' => 'high',
      'status' => 'publish',
      'autosave' => false,
      'fields' =>   array (
         
        array (
          'id' => 'my_field_id',....

add_filter( 'rwmb_my_field_id_value', function ( $value ) {
    $value = 'it works';
    return $value;
} );

but it doesnt work, welp 🙁