Skip to content

Instantly share code, notes, and snippets.

@jtsternberg
Last active June 8, 2023 16:53
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jtsternberg/8601075 to your computer and use it in GitHub Desktop.
Save jtsternberg/8601075 to your computer and use it in GitHub Desktop.
Create a theme options page with CMB2
@jtsternberg
Copy link
Author

@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.

@clifgriffin
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment