Allowing Editors to see the Subscriber list?
-
Hi I was trying to let an Editor be to see the list of subscribers, as at the moment only Your Subscriptions and Send Email are available to them, is there a way for them to have the Subscribers List?
Thanks
-
There is a way and it’s covered in the FAQs
Thanks .. yep, found it !!!
Hi – how can I show the Subscribers List to an Author? I have read the FAQ but am completely new to WordPress capabilities. What is the exact code?
Thanks!
See the example code for the ‘s2_capability’ hook here:
http://subscribe2.wordpress.com/support/api/Hi, thanks for the super fast reply. Would it work if I add the following to my child theme’s functions.php:
function s2_admin_changes( $capability, $menu ) {
// $capability is the core WordPress capability to allow admin pag
// $menu is the title of the page:
// 'user' for access to personal subscription settings
// 'manage' to allow access to the user management screen
// 'settings' to allow access to the plugin settings
// 'send' for access to the Send Email page
// identify the menu you are changing capability for first
// then return a new capability
if ( $menu == 'manage' ) {
return 'read';
}
return $edit;
}
add_filter('s2_read', 's2_admin_changes', 10, 2);
The code will work in that file but from what you have pasted above there is an issue – you are returning $edit for all menus other than ‘manage’ and yet the $edit variable is not defined.
How about this:
return $edit_posts;
Done! Thanks @mattyrob!
Here is the code I pasted into my child theme’s functions.php
function s2_admin_changes( $capability, $menu ) { // $capability is the core WordPress capability to allow admin pag // $menu is the title of the page: // 'user' for access to personal subscription settings // 'manage' to allow access to the user management screen // 'settings' to allow access to the plugin settings // 'send' for access to the Send Email page // identify the menu you are changing capability for first // then return a new capability if ( $menu == 's2_manage' ) { return 'read'; } return $edit_posts; } add_filter('s2_manage_options', 's2_admin_changes', 10, 2);
I don’t think that’s going to work for you. In the if statement you are looking for ‘s2_manage’ and it should be ‘manage’. Also, you are still passing back an undefined variable in $edit_posts, I think it would work better if that was left as $capability.
At least you are giving it a go though and hopefully learning a little as you go.
Hi @mattyrob,
The above code seemed to work fine but I tweaked it according to your feedback to avoid any potential errors. It now looks like this:
function s2_admin_changes( $capability, $menu ) { // $capability is the core WordPress capability to allow admin pag // $menu is the title of the page: // 'user' for access to personal subscription settings // 'manage' to allow access to the user management screen // 'settings' to allow access to the plugin settings // 'send' for access to the Send Email page // identify the menu you are changing capability for first // then return a new capability if ( $menu == 'manage' ) { return 'read'; } return $capability; } add_filter('s2_manage_options', 's2_admin_changes', 10, 2);
Great support like yours is ideal for those of us learning to adjust to WordPress π Thank you!
Hi there,
I copied the above code into the functions.php file and nothing changed.
What am I missing?
Thanks?
KarlYou may well not see a change as this code would allow all user levels below administrator to access the Subscribe2->Subscribers page where previously it would not have been available to them.
It you are an administrator you will already have access to that page so won’t see any difference.
Hi Mattyrob,
I know I can see the menu as admin but I also have an editor login and can see no difference there.
As an editor I still can’t see the subscriber list.Did you paste the code above into your functions.php file before the closing ?> at the end of the file or after it?
There doesn’t seem to be a closing ?> at the end of the file.
But I’ve put the code into the functions.php of the child theme and wrapped them in the <> php wrappers anyway.
- The topic ‘Allowing Editors to see the Subscriber list?’ is closed to new replies.