• Resolved alfaex

    (@alfaex)


    Hi.

    I need help to understand something, I looked in the code, on the wiki, on stackoverflow and google and I can’t make it work.

    On the exemple on the plugin there are this note.

    /**
    * Metabox for an options page. Will not be added automatically, but needs to be called with
    * the cmb2_metabox_form helper function. See https://github.com/WebDevStudios/CMB2/wiki for more info.
     */

    And this part i understand, i know that if i create my hooks with add_menu_page/add_submenu_page i need to call cmb2_metabox_form, it’s a similar behavior of the settings API

    What i don’t get it is why i have these options:

    
    'object_types' => array( 'options-page' ),
    'menu_title' => 'Site Options',
    'parent_slug' => 'tools.php', 
    capability' => 'manage_options', 
    'save_button' => 'Save Settings',
    

    To use with new_cmb2_box() if nothing happens, i spent 4 days trying to make this work and nothing, i don’t know if is some bug, or if i’m stupid.

    As long as I understand, if I have to manually create a subpage, I had used add_submenu_page.

    Why those option above need the same information from add_submenu_page and don’t create a submenu page.

    I searched on the code where those parameters are inserted on an add_submenu_page function, but i didn’t find add_submenu_page on the cmb2 code.

    Any help will be very apreciated.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Help with object_types => options-page’ is closed to new replies.