Updating saved metabox values in bulk

Support General Updating saved metabox values in bulkResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21462
    Jonathan BaileyJonathan 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' );

    #21467
    Long NguyenLong 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 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.