Using settings values for use in other metabox settings?

Support MB Settings Page Using settings values for use in other metabox settings?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16487
    badabingbredabadabingbreda
    Participant

    Over the past few months I have been using MB Settings to store a few site-values. Specifically, I used it to store a page-url that has a certain shortcode.
    I then used that url to show a link in the backend (when editing the post), because it was used to open that page with a query-var ?posthash=90beec18daf4ea8f9b2a9ce755c94046, so users can email links to a formhash, instead of a formid which is easily guessed or incremented.

    In the callback for the rwmb_meta_boxes for that CPT-settings I pulled up the rwmb_meta( 'fieldname' , array( 'object_type' => 'setting' ) , 'option_name' ) and that worked.

    But now, it returns NULL, instead of the value. I know there a value in there, because I've had to spend some time debugging and eventually changed it to get_option( 'option_name' )['fieldname'] (I used a little more sophisticated method than that, but roughly the same result) and it's fine again.

    What's really tripping me is that it worked before, but I now have to change it, receiving reports from client that things stopped working when updating something else. I hate to say it, but sometimes things seem to break for no apparent reason.

    Shouldn't this work (getting existing settings via rwmb_meta() inside another settings declaration callback) or am I doing something wrong?

    #16526
    Anh TranAnh Tran
    Keymaster

    Hi, would you mind giving more details on how you setup the settings pages? The latest version has big changes, which we made to work with Customizer/Network settings. Please send me more details to debug on this. In my test with a normal settings page, I couldn't replicate the bug.

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