Custom Fields
Re-Envisioned
Support General Updating saved metabox values in bulk

  • Creator
    Topic
  • #21462
    Resolved Jonathan Bailey
    Participant

    I have complex metabox values saved to the database.

    Is this still the recommended way of changing those values (the idea my code will differ).

    The below is from a post from the Keymaster dated March 2018

    function your_helper( $field_id ) {
    $field = rwmb_get_field_settings( $field_id );
    $value = rwmb_meta( $field_id );
    return $value ? $value : $field[‘std’];
    }

    // In your template
    echo your_helper( ‘your_title_field’ );

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #21467
    Long Nguyen
    Moderator

    Hi,

    Yes, it is a simple way to show the field’s value. If it is empty, show the field setting std or anything you want, if not, show the field value.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.