Skip to content

Instantly share code, notes, and snippets.

@drrobotnik
Last active August 29, 2015 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drrobotnik/293f9aafd03bc7b51506 to your computer and use it in GitHub Desktop.
Save drrobotnik/293f9aafd03bc7b51506 to your computer and use it in GitHub Desktop.
remove wp_rollback for certain cases
<?php
// Untested Gist
function remove_wp_rollback() {
if( class_exists( 'WP_Rollback' ) ) :
if( ! current_user_can( 'invented_cap' ) ) :
remove_action( 'plugins_loaded', array( 'WP_Rollback', 'load_textdomain' ) );
//Admin
remove_action( 'admin_enqueue_scripts', array( 'WP_Rollback', 'scripts' ) );
remove_action( 'admin_menu', array( 'WP_Rollback', 'admin_menu' ), 20 );
remove_action( 'pre_current_active_plugins', array(
'WP_Rollback',
'pre_current_active_plugins'
), 20, 1 );
remove_action( 'wp_ajax_is_wordpress_theme', array( 'WP_Rollback', 'is_wordpress_theme' ) );
remove_action( 'set_site_transient_update_themes', array( 'WP_Rollback', 'wpr_theme_updates_list' ) );
remove_filter( 'wp_prepare_themes_for_js', array( 'WP_Rollback', 'wpr_prepare_themes_js' ) );
remove_filter( 'plugin_action_links', array( 'WP_Rollback', 'plugin_action_links' ), 20, 4 );
endif;
endif;
}
add_action( 'plugins_loaded', 'remove_wp_rollback');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment