Help Update option value

Support MB Settings Page Help Update option value

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4327
    Infolu OfficialInfolu Official
    Participant

    personal need of help Hello, I know that is not part of the support would most like to receive a light

    Today when I need to update a field whether it be any of a post type I use
    $ Wpdb-> query ("UPDATE $ wpdb-> postmeta SET meta_key = 'name of the new field' WHERE meta_key = 'name of the old field' ');

    However this only works when the field in the database has only one data

    Mb_settings_pages all information is stored within a single field option_value

    In mb_settings_pages have a field with the ID: NAME and need to upgrade to ID: newname how to update the name field of a option_value ID without losing information?

    #4329
    Infolu OfficialInfolu Official
    Participant

    #4343
    Anh TranAnh Tran
    Keymaster

    Hi,

    You can run the following code:

    $option = get_option( 'option_name' );
    $option[$field_id] = $new_value;
    update_option( 'option_name', $option );
    #4366
    Anh TranAnh Tran
    Keymaster

    This is resolved on Github: https://github.com/rilwis/meta-box/issues/1001.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Help Update option value’ is closed to new replies.