• Resolved Philipp

    (@mrphilipp)


    Just installed W3 Total Cache on my WordPress Network. I want to edit all settings as Super-Admin but the Plugin displays the “Performance” Menu for every User. The Users cannot see the configuration but they can see the Perfomance Dashboard where they could delete the Cache and view the server configuration.

    Any ideas how to remove the menu item or how to block the access to it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Now that is the kind of fiddling I like to do!

    Here’s a “works for me” snippet I offer from my “mu-plugins”:

    <?php
    function ds_w3tc_remove_menu() {
       global $submenu, $menu;
    	if( ! is_super_admin() ) {
    		if(!empty($menu)) {
    			foreach($menu as $key => $sm) {
    			if(__($sm[0]) == __('Performance') || $sm[2] == "w3tc_dashboard") {
    				unset($menu[$key]);
    				unset( $submenu[ 'w3tc_dashboard' ] );
    				break;
    				}
    			}
    		}
    	}
    }
    add_action('admin_menu', 'ds_w3tc_remove_menu',11);
    
    function ds_w3tc_remove_adminbar() {
       global $wp_admin_bar;
         if ( ! is_super_admin() ) {
     	$wp_admin_bar->remove_menu('w3tc');
    	}
    }
    add_action( 'admin_bar_menu','ds_w3tc_remove_adminbar',999);
    ?>
    Thread Starter Philipp

    (@mrphilipp)

    Thanks! It works!

    Try this simple code

    function clean_admin_dashboard() {
    if ( !is_super_admin() ) :
        remove_menu_page( 'w3tc_dashboard' );
    endif;
    }
    add_action( 'admin_init', 'clean_admin_dashboard');
    
    function remove_admin_bar_links() {
    if ( !is_super_admin() ) :
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu('w3tc');
    endif;
    }
    add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

    Hello, and this code works with WP 3.9 and W3T 0.9.4.? Can you explain how can I use it? or Is it secure to let the item there? Thank you!

    Yes, It Does Work. I Tried It. It Works ??

    Can you explain how can I use it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove W3 Total Cache Menu’ is closed to new replies.