rwmb_the_value return 1st value of array.

Support General rwmb_the_value return 1st value of array.Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28915
    PAUL TUNNICLIFFEPAUL TUNNICLIFFE
    Participant

    Is there a way you can return the only 1st value of a array returned by rwmb_the_value?

              <?php
                 $body = 'image_upload_gallery_field_Sz3Nx6';
                 $body_value = rwmb_the_value( $body );
                 ?>
    

    Also is there a way to flatten the returned array into a string of text?
    I have an automotive website where the make/model is set by a select tree field. I can return the values, but when displaying on the page I'd prefer it to be a string of text rather than list.

    #28932
    Long NguyenLong Nguyen
    Moderator

    Hi Paul,

    You can refer to this topic to style the value of the list in one line https://support.metabox.io/topic/how-to-display-select-advanced-as-text-instead-of-bulletpoints/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.