Return value of rwmb_meta

Support General Return value of rwmb_meta

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2559
    cardinalacres_oldcardinalacres_old
    Participant

    I'm using the MB Builder plugin along with leveraging the rwmb_meta function to add display of custom meta to some pages of a theme.

    For custom meta of type "radio", when I use the rwmb_meta function to return a value I'm getting what is entered in the "value" field instead of the "label" field of MB Builder. Perhaps I'm misunderstanding how custom meta is intended to work, but this seems backwards. What I want is to have the "label" (i.e., the human-readable format) returned via rwmb_meta.

    Any help/clarification is appreciated...

    #2561
    Anh TranAnh Tran
    Keymaster

    Hi, you're right about rwmb_meta(). It returns the value stored in the meta value.

    If you want to retrieve the label, instead of value, you can use the internal helper function:

    rwmb_the_value( $field_id )

    This function accepts the same arguments as rwmb_meta and it displays the "meaningful" value to human.

    rwmb_the_value( $field_id, $args = array(), $post_id = null, $echo = true )

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Return value of rwmb_meta’ is closed to new replies.