The capability checked for most plugin related display is ‘activate_plugins’. There’s no clean way to completely block specific plugins from appearing. There are filters for the action links below each plugin name and a filter for the description meta data, but nothing for the plugin name or the entire row.
To do what you want without hacking core files would require defining your own version of WP_Plugins_List_Table, removing the current plugins menu items, and adding your own menu items that display plugins using your version of WP_Plugins_List_Table.
You could deter many users by just hiding specific content with jQuery, but any halfway intelligent user could look at the page source to see the hidden content, or use their browser’s CSS inspector to enable the display of hidden content.
The capability checked for most plugin related display is ‘activate_plugins’.
…or manage_options.
pmbs, does your custom role have manage_options capability? If so, try removing it and seeing whether that solves the issue, though it may also remove access to other plugins that you do want the custom role to have access to. If this is the case, as bcworkz says there’s no clean way around it.
Thread Starter
pmbs
(@pmbs)
Thanks, guys. Tried removing every capability as stated here, but I guess it just isn’t possible without editing core files. Ended up removing it from the menu with CSS, which will do okay in this case.