{"action":"opened","issue":{"url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/514","labels_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/514/comments","events_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/514/events","html_url":"https://github.com/WebDevStudios/CMB2/issues/514","id":115220136,"number":514,"title":"Conditional statement using checkbox from options page (fatal error)","user":{"login":"dwruck","id":845734,"avatar_url":"https://avatars.githubusercontent.com/u/845734?v=3","gravatar_id":"","url":"https://api.github.com/users/dwruck","html_url":"https://github.com/dwruck","followers_url":"https://api.github.com/users/dwruck/followers","following_url":"https://api.github.com/users/dwruck/following{/other_user}","gists_url":"https://api.github.com/users/dwruck/gists{/gist_id}","starred_url":"https://api.github.com/users/dwruck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwruck/subscriptions","organizations_url":"https://api.github.com/users/dwruck/orgs","repos_url":"https://api.github.com/users/dwruck/repos","events_url":"https://api.github.com/users/dwruck/events{/privacy}","received_events_url":"https://api.github.com/users/dwruck/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-05T06:48:15Z","updated_at":"2015-11-05T06:48:15Z","closed_at":null,"body":"I am trying to create a theme options page with checkboxes that, if checked, will enable various but related custom post types. \r\n\r\nNo matter what I do I keep getting this error: Fatal error: Call to undefined function cmb2_get_option()..... on line 189. \r\n\r\nI have worked on this all day long and have even purchased and watched most of Justin's CMB2 session from WP Sessions. I would like to simply wrap this line in a conditional statement from a checkbox: <pre>require_once( $this->directory_path . '/post-types/staff.php' );</pre> I followed the settings from this page (changed out the myprefix obviously): https://github.com/WebDevStudios/CMB2-Snippet-Library/blob/master/options-and-settings-pages/theme-options-cmb.php. \r\n\r\nHere is my code from line 189: <pre>function compel_get_option( $key = '' ) {\r\n\treturn cmb2_get_option( compel_admin()->key, $key );\r\n}</pre>\r\n\r\nThis is the checkbox field I was trying to add: <pre>\t$cmb->add_field( array(\r\n\t\t\t'name' => __( 'Staff' ),\r\n\t\t\t'desc' => __( 'Select to include staff features' ),\r\n\t\t\t'id'   => 'compel_checkbox',\r\n\t\t\t'type' => 'checkbox',\r\n\t\t) );</pre>\r\n\r\nAny help with this error would be greatly appreciated."}}