Custom Fields
Re-Envisioned
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

foundbutlost
Participant

I tried this after found this thread https://metabox.io/support/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 🙁