cmb2 loading too late?
-
Hey there!
I’m using cmb2 to create an options page as suggested here (https://github.com/CMB2/CMB2-Snippet-Library/blob/master/options-and-settings-pages/theme-options-cmb.php)
I can’t simply use something like this in my functions.php:
if ( myplugin_get_option('my_option') ) { // do something }
I always need to wrap that in a hook and figured that the earliest hook i can use is wp_loaded.
Is there any way to workaround that?
The working example would look something like this:
add_action( 'wp_loaded', 'my_function' ); function my_function() { if ( myplugin_get_option('my_option') ) { // do something } }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘cmb2 loading too late?’ is closed to new replies.