Support Forum ยป User Profile

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Update field before saving #2027
    tandoigaitandoigai
    Participant

    After digging into your code, I found the solution myself.

    Here's the solution for those who need:

    // there's a filter to alter value before post being saved
    add_filter ( 'rwmb_NAME_value', 'somefunction' );
    
    function somefunction() {
    
    // get data
    $get_data = isset( $_POST['SOMEKEY'] ) ? $_POST['SOMEKEY'] : null;
    
    // do something with your data, multiple by 100 for instance
    $modified_data = $get_data *100;
    
    // return the modified data
    return $modified_data;
    }

    Anyway thank you for crafting many hooks for ease of use.

    Cheers.

Viewing 1 post (of 1 total)