Custom Fields
Re-Envisioned
Support MB Settings Page Cannot get rwmb_get_object_fields to work for setting object

  • Creator
    Topic
  • #17340
    badabingbreda
    Participant

    I’m having trouble returning the object fields for a settings_page.

    I’ve tried every possible combination I can think of, but I’m only getting an empty array in return:

    If I query a meta-field that’s stored in a settings_page I use

    $field = rwmb_meta( 'bevestiging' , array( 'object_type' => 'setting' ) , 'company_settings' );
    

    If I try to get the object fields stored from a settings_page, I use

    $fields = rwmb_get_object_fields( 'company_settings', 'setting' );
    

    But it returns nothing. What am I doing wrong here?

    Using MB 5.2.3 and MB Settings 2.0 (Using Composer, since it’s part of a plugin)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #17416
    Anh Tran
    Keymaster

    Hi,

    Thanks a lot for your feedback! There was a bug with that function for settings page. I’ve just fixed it. Now you can use this code:

    $fields = rwmb_get_object_fields( 'settings-page-id', 'setting' );
    

    Just note that the 1st item should be settings page ID, not option name.

    #17420
    badabingbreda
    Participant

    I’m still getting the same MB version as before, 5.2.3. The code is identical as before, so my guess is you still need to push it to packagist, or am I using the wrong version (dev-trunk)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash