rwmb_set_meta returns nothing

Support General rwmb_set_meta returns nothingResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34594
    netalysnetalys
    Participant

    Hi !
    Does function rwmb_set_meta returns something ?
    In my script, the function works perfectly well but doesn't returns anything...
    If it's right, it would be awesome if returns true on success.
    Thanks.

    #34604
    Long NguyenLong Nguyen
    Moderator

    Hi,

    This helper function does not return anything. It helps you to set meta value for an object. Please read more on the documentation https://docs.metabox.io/rwmb-set-meta/

    After setting the value, you can use the helper function rwmb_meta() to retrieve the value.

    #35172
    netalysnetalys
    Participant

    OK. I think it could be useful to know if the value has correctly been set by returning true or false in case an error occured...

    #44472
    Shalom PenningtonShalom Pennington
    Participant

    I second this, @netalys. Being able to do something like this would be very helpful:

    $result = rwmb_set_meta( $post_id, $field_id, $value );
    
    if ($result === true) {
        // update successfully
    } else {
        // update failed
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.