2

I developed the theme. Redux Framework configuration file located in the theme directory. Himself ReduX Framework I installed from the repository Wordpress using the TGM. But when I install a theme, then this message appears

Redux Framework has an embedded demo. Click here to activate the sample config file.

and I need to click on the link for load my options!

How can I make so that my settings are automatically loaded?

functions.php in my theme

/**
* Redux
*/
if ( class_exists( 'ReduxFramework' ) ) {
    require_once( dirname( __FILE__ ) . '/inc/options-init.php' );
}

2 Answers 2

2

Problem solved! Helped official support. It was necessary to add the following code.

add_action( 'redux/loaded', 'remove_demo' );
/**
 * Removes the demo link and the notice of integrated demo from the redux-framework plugin
 */
if ( ! function_exists( 'remove_demo' ) ) {
    function remove_demo() {
        // Used to hide the demo mode link from the plugin page. Only used when Redux is a plugin.
        if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
            remove_filter( 'plugin_row_meta', array(
                ReduxFrameworkPlugin::instance(),
                'plugin_metalinks'
            ), null, 2 );

            // Used to hide the activation notice informing users of the demo panel. Only used when Redux is a plugin.
            remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) );
        }
    }
}
0

I want to add something to this answer. This won't work if you use TGMPA. But if you want to suppress the this message:

Redux Framework has an embedded demo. Click here to activate the sample config file.

You can add the following to your functions.php file.

add_action('admin_init', 'override_redux_message', 30);

function override_redux_message() {
    update_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', []);
}

This will prevent the message from showing. Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.