Gestione dei ruoli | WordPress.org

[ad_1]

Plugin Author
Jose

(@giuse)

Hi @gianlu74,

I tried to reproduce the same issue but I never see the link that you mentioned.

Normally, Freesoul Deactivate Plugins shows the links to its pages only to the users who can activate/deactivate plugins from the plugins page, or to the users who have the role FDP Viewer and FDP Manager even thought these two roles haven’t the capability to activate/deactivate plugins.

Do you have any plugin that manipulates the normal behaviour of roles and capabilities?

I can give you some suggestions to hide the link that you mentioned but I can’t ensure it will work because you should already not see that link.

Add this code to the functions.php of your theme, or to a functional plugin:

add_filter( 'eos_dp_settings_capability', function( $capability ) {
	return 'manage_options';
} );

The code above will replace the capability active_plugins with manage_options, and only those who can manage options (normally, only the administrators) can see Freesoul Deactivate Plugins. As said, it may not work if the cause of your issue also interferes with this possible solution.

If you want to hide that link only to a couple of users, you can also try to go to their user profile and uncheck “Admin menu” in the FDP Preferences.

I hope it helps.

Have a great day!

Jose

  • This reply was modified 2 hours, 7 minutes ago by Jose.

Thanks for the reply.

I added the provided snippet to the functions.php, but nothing.

Here foolowing links to screenshots of:

– “Shop Manager” backend where you see the link to FDP:

-“Administrator” backend with FDP Settings > Role Manager:

– plugin list:

Thanks again

Plugin Author
Jose

(@giuse)

Thanks to you for the information.
If nothing helps, I suggest you hide the FDP menu item with this code:

add_action( 'admin_head', function() {
	if( ! current_user_can( 'manage_options' ) ) {
	?>
	<style id="hide-fdp-menu-item">#toplevel_page_eos_dp_menu{display:none !important}</style>
	<?php
	}
} );

The code above will hide the FDP menu item if the user hasn’t the rights to manage options.

Ok, it works, thank you very much Josè.

Plugin Author
Jose

(@giuse)

Perfect, I’m happy it works.

Have a great day!
Jose

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer