You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen how CMB2 can be used in admin menu pages (creating a theme options page, for example).
Just wondering if it's possible to use it on a pre-existing submenu page?
For example, I have a custom post type called 'faqs', and in the wordpress backend, hovering over the faqs top-level menu I'm able to "Add new faq", "View all faqs" and see "faq categories" - and want to add a submenu page ("faq settings").
I'd like to add CMB2 fields to this custom post type's submenu page.
Do you know if, as it stands, this can be done?
If the above can't be achieved, do you know if it's possible to create a submenu page with CMB2? (rather than adding CMB2 fields to an existing one).
Activity
joneslloyd commentedon Apr 23, 2015
I've actually figured out how to create a CMB2-only submenu page, so I'll close this.
Thanks!
alucav commentedon Dec 23, 2017
@joneslloyd care to share how you figured this out? You cluttered google with your question, but there's no solution. Boo.
jtsternberg commentedon Dec 23, 2017
You can see a commented-out example of setting to a submenu in the example-functions.php file:
CMB2/example-functions.php
Line 665 in 6fce2e7
I've also added a couple examples to the snippet library: https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/submenu-options-pages.php
jtsternberg commentedon Dec 23, 2017
Also possibly helpful, snippet to show how to register a main options page with multiple submenu option pages: https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-submenus.php
Or, similar snippet but with added tabbed navigation among those menu pages: Doing submenu pages with tabbed navigation snippet can be found here: https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/options-pages-with-tabs-and-submenus.php
Enable tabbed-nav for options-pages via tab_group prop. See #301, #627