How to remove Redux Framework Notice?

wordpress

#1

Hi, Recently i got soft rejected and i have to change some things before theme goes live. One of question is : Please Remove Redux Framework Notice, and Reviewer send me some screenshot with 4 Notice: e.g. Redux Framework: New Documentation, Redux Framework New update… Bla Bla Bla. Is there a method to hide this Notices? Thanks for your time, and sorry for my English👍


#2

Enquee style sheet for admin and add this CSS

.redux-dev-mode-notice-container.redux-dev-qtip { display: none; }
.rAds {
    width: 0;
    height: 0;
    visibility: hidden;
}
.redux-messageredux-notice {
    display: none !important;
}

#3

Hi @themevendors, thanks for your help, i made exactly what you say but Notice is still present,
And this appear only when theme is activated, if i refresh the page the Notice is gone… I don’t know what to do… Thanks for your time :+1:


#4

Shoot this code to functions.php

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' ) );
        }
    }
}

#5

@themevendors i will try this one to see if work, i will reply you as soon as i can. Thanks for your help👍, I really appreciate


#6

Paste these lines in functions.php file and change the themename :

if ( ! function_exists( 'themename_remove_anonymous_object_filter' ) ){

function themename_remove_anonymous_object_filter( $tag, $class, $method ) {
    $filters = $GLOBALS['wp_filter'][ $tag ];
    if ( empty ( $filters ) ) {
      return;
    }
    foreach ( $filters as $priority => $filter ) {
        foreach ( $filter as $identifier => $function ) {
            if ( is_array( $function)
                and is_a( $function['function'][0], $class )
                and $method === $function['function'][1] ) {
                
                remove_filter(
                    $tag,
                    array ( $function['function'][0], $method ),
                    $priority
                );
            }
        }
    }
}

}
function themename_remove_redux_framework_admin_notices_action() {
themename_remove_anonymous_object_filter(
‘admin_notices’,
‘ReduxFramework’,
’_admin_notices’
);
}
add_action(‘admin_init’, ‘themename_remove_redux_framework_admin_notices_action’);


#7

This should help: How to solve this redux problem


#8

@themevendors, @khalilthemes, @imithemes. Thanks guys for your help, i can’t figure out how to hide this Notice, unfortunatly is not working guys. Thanks for your time and help :+1:


#9

I faced the same issue, then i used the above codes and finally my theme approved! You may give a try.


#10

@khalilthemes , i will try your code, because i don’t have other options, I just hope that Reviewer will don’t see that Notice. Thank’s again all of you guys for your time😉


#11

In redux 3.6.0.2 in framework.php
256 line, transform into: /$this->change_demo_defaults();/
and line 3954 to 3988

/*
private function change_demo_defaults() {
if ( $this->args[‘dev_mode’] == true || Redux_Helpers::isLocalHost() == true ) {
if ( ! empty( $this->args[‘admin_bar_links’] ) ) {
foreach ( $this->args[‘admin_bar_links’] as $idx => $arr ) {
if ( is_array( $arr ) && ! empty( $arr ) ) {
foreach ( $arr as $x => $y ) {
if ( strpos( strtolower( $y ), ‘redux’ ) >= 0 ) {
$msg = __( ‘Redux Framework Notice: There are references to the Redux Framework support site in your config’s admin_bar_links argument. This is sample data. Please change or remove this data before shipping your product.’, ‘redux-framework’ );
$this->display_arg_change_notice( ‘admin’, $msg );
$this->omit_admin_items = true;
continue;
}
}
}
}
}

                if ( ! empty( $this->args['share_icons'] ) ) {
                    foreach ( $this->args['share_icons'] as $idx => $arr ) {
                        if ( is_array( $arr ) && ! empty( $arr ) ) {
                            foreach ( $arr as $x => $y ) {
                                if ( strpos( strtolower( $y ), 'redux' ) >= 0 ) {
                                    $msg = __( '<strong>Redux Framework Notice: </strong>There are references to the Redux Framework support site in your config\'s <code>share_icons</code> argument.  This is sample data.  Please change or remove this data before shipping your product.', 'redux-framework' );
                                    $this->display_arg_change_notice( 'share', $msg );
                                    $this->omit_share_icons = true;
                                }
                            }
                        }
                    }
                }

            }
        }

*/


#12

I was also having this problem, and I managed to solve it this way:

/** REMOVE REDUX MESSAGES */
function remove_redux_messages() {
	if(class_exists('ReduxFramework')){
		remove_action( 'admin_notices', array( get_redux_instance('theme_options'), '_admin_notices' ), 99);
	}
}

/** HOOK TO REMOVE REDUX MESSAGES */
add_action('init', 'remove_redux_messages');

If you are not using Redux as a plugin this may work. But if you use it as a plugin, you can follow the example of the Redux page:
https://docs.reduxframework.com/core/the-basics/removing-demo-mode-and-notices/


#13

hi i’m in same problem.
but I don’t know where that code to pase.:weary:


#14

You can put the code I indicated just above in your functions.php file.