Skip to content

Instantly share code, notes, and snippets.

@CurtisL
Last active July 10, 2018 17:19
Show Gist options
  • Save CurtisL/d64791d92c73c455453d to your computer and use it in GitHub Desktop.
Save CurtisL/d64791d92c73c455453d to your computer and use it in GitHub Desktop.
When including Redux in a theme for a client, this removes the nags and notices.
<?php
/**
* Disable News Blast
*/
$GLOBALS['redux_notice_check'] = false;
/**
* Disable Update Notice
*/
$GLOBALS['redux_update_check'] = false;
/**
* Hide the Tools Submenu
*/
add_action( 'admin_menu', 'remove_redux_menu', 12 );
function remove_redux_menu() {
remove_submenu_page( 'tools.php', 'redux-about' );
}
add_action( 'init', 'sg_redux_framework_cleanup' );
function sg_redux_framework_cleanup() {
// Remove demo notices
if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
remove_filter( 'plugin_row_meta', array( ReduxFrameworkPlugin::instance(), 'plugin_metalinks' ), null, 2 );
remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) );
}
// Remove tracking
if ( class_exists( 'Redux_Tracking' ) ) {
// Remove the tracking request notice.
remove_action( 'admin_enqueue_scripts', array( Redux_Tracking::get_instance(), '_enqueue_tracking' ) );
// Remove the newsletter tracking nag.
remove_action( 'admin_enqueue_scripts', array( Redux_Tracking::get_instance(), '_enqueue_newsletter' ) );
}
}
@maxledoux
Copy link

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment