Last active
July 10, 2018 17:19
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you.