Support » Plugin: Redis Object Cache » suggestions: Hide Redis Dashboard Meta Box for non-Administrators

  • Resolved ChrisL

    (@chrslcy)


    Showing the Redis dashboard meta box to all admin users does not make sense. I suggest you only display it for administrators.

    For those looking to hide it for non-administrators, here the code for that:

    add_action( 'do_meta_boxes', 'remove_plugin_dashboard_meta' );
    
    function remove_plugin_dashboard_meta(){
        if ( !current_user_can('administrator') ) {
            remove_meta_box( 'dashboard_rediscache', 'dashboard', 'normal' );
        }
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.