Advanced Usage - krunchness/CMB2 GitHub Wiki
Table of Contents
- Using CMB2 to create an Admin Theme Options Page
- Bringing Metaboxes to the Front End
- Create New Posts (or Custom Post Type) Entries Using A Front End Form
- JavaScript validation for CMB2 fields
- JavaScript validation of "required" fields
Using CMB2 to create an Admin Theme Options Page
This snippet has been moved to the CMB2 Snippet Library.
Remember to replace instances of myprefix
and Myprefix
with something unique to your code.
Retrieving saved data from the options page
Use the myprefix_get_option
function included in the above snippets (obviously changing the prefix):
$field_value = myprefix_get_option( 'field_id' );