I have created a theme and embed the redux framework with this code
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/ReduxCore/framework.php' ) ) {
require_once( WPESTATE_PLUGIN_PATH . '/ReduxFramework/ReduxCore/framework.php' );
require_once( WPESTATE_PLUGIN_PATH. '/ReduxFramework/loader.php' );
}
if ( !isset( $redux_demo ) && file_exists( dirname( __FILE__ ) . '/ReduxFramework/sample/sample-config.php' ) ) {
require_once( WPESTATE_PLUGIN_PATH. '/ReduxFramework/admin-config.php' );
}
In theme files i can access the the global $opt_name and everything works fine
After that i have created a functionality plugin. In this plugin i cannot access $opt_name , probably because the reduxframework is not initialized yet.
I read here Redux Framework not working when used in plugin that i should use Redux::init('opt_name') inside my plugin. However is not clear how since the class Redux is not existing yet.
Should i use it in after_setup_theme hook ? What will be the best way ? Thank you