This snippet has been moved to the CMB2 Snippet Library.
-
-
Save jtsternberg/8601075 to your computer and use it in GitHub Desktop.
taxonomy_multicheck working but not in admin display - its always show all the checkboxes checked
Is there a hook to display a message when the metabox gets saved?
Is there a way to use this to create multiple options/sections? Basically I want to have "Social Links", "Homepage Layout", etc as sections that have their own custom fields..
Like any other Theme Options panels that come with themes these days.
Can repeatable groups work in here? I cant get it to...
@amitrahav taxonomy_multicheck is for setting terms on posts/users. It shouldn't be used for an admin page. @mauricenaef you can use the 'admin_notices' hook. @owldesign you can use the 'title' field type to highlight sections. @thatryan yes, should work the same.
Important to note: the key that makes CMB2 save the data is line 104: https://gist.github.com/jtsternberg/8601075#file-theme-options-cmb-php-L104
show_on
must be an array and key must be set to "options-page". This was not obvious to me as I deconstructed this.
Line 143 should be 'cmb2_get_option' in order for this to work with CMB2.