Viewing 15 replies - 1 through 15 (of 27 total)
  • @rustywood,

    There is a way and it’s covered in the FAQs

    Thread Starter RustyWood

    (@rustywood)

    @mattyrob

    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!

    @gphx,

    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);

    @gphx,

    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);

    @gphx,

    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?
    Karl

    @karl,

    You 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.

    @karl,

    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.

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘Allowing Editors to see the Subscriber list?’ is closed to new replies.