• Resolved AustinWeb

    (@austinweb)


    Hello:

    I need to remove the smushit link from the admin menu (under media) from a client’s site. Only admins can see.

    Here is what I have in the functions.php file, but it is not removing it for editors.

    // Remove Smushit from dashboard menu items if not admin
        if (!(current_user_can('administrator'))) {
    	function remove_smush() {
    
                remove_submenu_page('upload.php','upload.php?page=wp-smush-bulk');
    
    	}
    	add_action('admin_menu', 'remove_smush');
         }

    Any help would be appreciated. Thanks

    https://www.ads-software.com/plugins/wp-smushit/

Viewing 1 replies (of 1 total)
  • Hi @austinweb,

    add_action( '_admin_menu', 'remove_smush_menu', 1 );
    function remove_smush_menu() {
    	global $wpsmushit_admin;
    	if ( ! is_super_admin() ) {
    		//Remove Smush Menu from media library
    		if( is_object( $wpsmushit_admin ) ){
    			remove_action( 'admin_menu', array( $wpsmushit_admin, 'screen' ) );
    		}
    	}
    }

    This should work for you.

    Cheers

Viewing 1 replies (of 1 total)
  • The topic ‘Remove Smushit from admin menu’ is closed to new replies.