• Hello,

    I’m using Redux Framework to integrate theme options panel into my theme. so I have one global variable to use. And everything works perfectly except this file:

    global $variable;

    /**
    * this check here doesn’t work because the global variable isn’t set at all
    */

    if(isset($variable[‘title_area’]) && $variable[‘title_area’]) {
    require_once ‘title-area.php’;
    }

    function cmb2_initialize_meta_boxes(){
    require_once( INCLUDES_PATH . ‘/metaboxes/CMB2/init.php’);
    }

    add_action( ‘init’, ‘cmb2_initialize_meta_boxes’, 9999 );

    I know this is more of a PHP problem than WP but if you guys can help I would really appreciated it.
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • From the CMB2 side, you should NEVER include CMB2/init.php on or after the init hook. Either include it directly:

    require_once( INCLUDES_PATH . '/metaboxes/CMB2/init.php');

    or on an earlier hook:

    add_action( 'setup_theme', 'cmb2_initialize_meta_boxes', 9999 );

    Thread Starter kajdzo

    (@kajdzo)

    The idea was to check if the hook didn’t worked to include it directly, really didn’t wrote it well ?? Thanks for pointing out my error, I fixed it, thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘title area issue’ is closed to new replies.