Editor Dashboard
-
I want editors to view both the Cleantalk Antispam and Security displays. I tried using the ‘User Role Editor’ plugin but with no luck. Is there a way I can do this?
-
Hello @lukedouglas,
Could you please clarify what displays you’re referring to? A screenshot would be greatly appreciated.
Thank you.
I have a side by side screenshot with an Administrator on the left side and an Editor on the right side. As you can see, the Administrator can view the CleanTalk displays but it does not display on Editor dashboards. I want to give Editor’s the ability to view the CleanTalk displays.
https://drive.google.com/file/d/1tUKyaatKxPJdZXL1By0e_cVqydIVdlQ7/view?usp=drive_link
Honestly, CleanTalk needs to add this ability inside their plugins. Other’s have this ability.
-
This reply was modified 11 months ago by
lukedouglas.
Hello @lukedouglas,
Thank you for your explanation. Unfortunately, by default, only administrators can see widgets. However, you will be able to change the user roles and their permissions with the “User Role Editor” plugin:
https://ww.wp.xz.cn/plugins/user-role-editor/
Please let me know if this helps.
I tried that plugin and was unsuccessful.
I will ask our developers if it is possible to do something more. We will contact you within 1-3 business days.
Hello,
We’ve added roles for Anti-Spam widgets. You can try this version:
- Go to WordPress Administrator Panel —> Plugins.
- Find the plugin “Anti-Spam by CleanTalk” —> Deactivate.
- After the automatic page refreshing find the plugin again “Anti-Spam by CleanTalk” —> Delete. Confirm files deletion.
- Download the plugin archive from the link.
- Go to Plugins —> Add New —> Upload Plugin.
- Choose the downloaded archive and press “Install Now”.
- After the installation, activate the plugin, make sure that the access key matches the key from your CleanTalk Dashboard.
To add a role, please add this code to the functions.php of your WordPress theme (example code for the editor role):
add_filter(‘apbct_hook_dashboard_widget_allowed_roles_list’, function($roles_list) {
$roles_list[] = ‘editor‘;
return $roles_list;
});Did it work?
We plan to add a similar feature for the Security widget, but it may take up to 3 months.
I already had the plugin installed so I just replaced it. I still showed it was connected to CleanTalk.
I used the Theme Editor to edit the functions.php file, but as you didn’t provide ‘where’ the code should go, I tried it in two locations, below line (28) and below line (47), added to the code so you know where. Didn’t work. Was there a plugin setting I needed to set?(28)add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
/**Cleantalk code to allow editor view on dashboard of Anti-Spam */
add_filter(‘apbct_hook_dashboard_widget_allowed_roles_list’, function($roles_list) { $roles_list[] = ‘editor‘; return $roles_list;});
if ( ! function_exists( ‘organizing_pro_setup’ ) ) :function organizing_pro_setup() {
if ( ! isset( $content_width ) )
$content_width = 640; /* pixels */load_theme_textdomain( 'organizing-pro', get_template_directory() . '/languages' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'woocommerce' );
add_theme_support( 'title-tag' );
(47)add_filter('widget_text', 'do_shortcode');
/**Cleantalk code to allow editor view on dashboard of Anti-Spam */
add_filter('apbct_hook_dashboard_widget_allowed_roles_list', function($roles_list) { $roles_list[] = '*editor*'; return $roles_list;});
add_image_size('homepage-thumb',240,145,true);Hello @lukedouglas,
Thank you for your feedback. We’ll check it.
I’d like to mention that in the $roles_list[] = ‘editor‘; line, you should put the exact name of the role. Could you please confirm that the role is named ‘editor’?
I see misspelling of the line
$roles_list[] = ‘editor‘;in your example. Please replace$roles_list[] = '*editor*';to$roles_list[] = ‘editor‘;-
This reply was modified 11 months ago by
amagsumov.
I change the spelling as well as change ‘editor’ to ‘Editor’ since that is the Role name.
However, I got an ‘uncaught Error’.
Undefined constant “‘apbct_hook_dashboard_widget_allowed_roles_list’” in wp-content/themes/organizing-pro/functions.php:49Hello.
- Please, make sure the plugin is updated with https://github.com/CleanTalk/wordpress-antispam/releases/download/fix-version/cleantalk-spam-protect.zip
- Please make sure that the code is strictly equal as below:
add_filter('apbct_hook_dashboard_widget_allowed_roles_list', function($roles_list) {
$roles_list[] = 'editor';
return $roles_list;
});Make sure that single quotes are not doubled, and there are no additional symbols around them.
The code above works form me, however, probably you could rename the role as it presented in your local env, probably you should use the first uppercase symbol – ‘Editor’.
We suppose that the issue is about copying the code from a WP comment.
-
This reply was modified 11 months ago by
alexandergull. Reason: added a note for role
Not sure exactly which was the offending character but copy/pasting the code from the email into Notepad and then copy/pasting it into the functions.php worked.
So I’m guessing there is no way to achieve this simply by installing a plugin update as it appears the theme functions.php file must have this code. Is that correct?Thank you for the update. Correct, this is the only way now. We will discuss with the team the variant without interfering with the theme code and will inform you about the solution within 3 business days.
Our team decided to leave the current solution in place.
Is there anything else we can help you with?
Hello.
We haven’t heard back from you in a few days, so I’m going to mark this topic as “resolved”.
If you have any further questions, you can start a new topic or contact us via our private Ticket System: https://cleantalk.org/my/support/open. -
This reply was modified 11 months ago by
The topic ‘Editor Dashboard’ is closed to new replies.