Skip to content

Instantly share code, notes, and snippets.

@MogulChris
Created February 13, 2019 01:39
Show Gist options
  • Save MogulChris/0f57e46b91b6e9fe986bc37239de9eff to your computer and use it in GitHub Desktop.
Save MogulChris/0f57e46b91b6e9fe986bc37239de9eff to your computer and use it in GitHub Desktop.
Remove annoying Redux Framework notices and links
/**
* When used by other plugins, the Redux Framework adds obtrusive dashboard widgets, notices and menu items when wp_debug is enabled, on the assumption that nobody uses WP_DEBUG_LOG on production sites.
* This code removes these
*/
//Remove widget
function my_framework_remove_redux_stuff(){
global $wp_meta_boxes;
if(!empty($wp_meta_boxes['dashboard']['side']['high']['redux_dashboard_widget'])){
unset($wp_meta_boxes['dashboard']['side']['high']['redux_dashboard_widget']);
}
}
add_action('wp_dashboard_setup','my_framework_remove_redux_stuff',100);
//Remove admin notices
$redux = ReduxFrameworkInstances::get_instance('wpml_settings');
remove_action('admin_notices', array($redux, '_admin_notices'), 99);
//Remove menu item
add_action( 'admin_menu', 'my_framework_remove_redux_menu',12 );
function my_framework_remove_redux_menu() { remove_submenu_page('tools.php','redux-about'); }
@MogulChris
Copy link
Author

Note this is only for the version of Redux which ships with WP Mail Logging. The line:

$redux = ReduxFrameworkInstances::get_instance('wpml_settings');

looks for the specific Redux instance created by WP Mail Logging.

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