How to add roles for which the widget will be displayed in the WordPress dashboard

By default, the Anti-Spam plugin widget is displayed only for users with the Administrator role. You can add roles for which the widget will also be displayed. To do this, add the code to the functions.php file of the theme you are using:

                                
add_filter('apbct_hook_dashboard_widget_allowed_roles_list', function($roles_list) { $roles_list[] = 'role_1'; // Optional. Uncomment the line if necessary. You can continue the list // $roles_list[] = 'role_2'; return $roles_list; } );

Write the name of the existing role instead of role_1. The default WordPress role must be written in English.

 

The widget that is displayed for a role other than Administrator will not contain a link leading to the CleanTalk dashboard.

Widget in WordPress dashboard

 

 

If you haven't found the answer to your question, please, contact our support team:

https://cleantalk.org/my/support/open

 

 

Was this information helpful?

It would also be interesting

Copied to clipboard