WordPress.org

Ready to get started?Download WordPress

Forums

How do I restrict users in Subscribe2? (4 posts)

  1. saintandrews
    Member
    Posted 2 years ago #

    I'm looking to set up a blog for multiple authors where I would be the sole administrator.

    From within Subscribe2 in their dashboard sidebars, how do I prevent my users in lesser roles, mostly authors, from

    -under "Your subscriptions" selecting (all their fellow blog users including themselves and me) "Do not send notifications for post made by these authors" and

    -under "Send Email" emailing all other blog users at will?

    In other words, how can I restrict my blog users to only accessing and managing their own Email subscription preferences and nothing else if I use Subscribe2 as an Email subscription plugin?

    Thanks

  2. mattyrob
    Member
    Posted 2 years ago #

    @saintandrews,

    Copied from the FAQ:

    I want to change the kinds of users who can access the Subscribe2 menus. Is that possible?
    Yes, it is possible with a little bit for code either in a custom plugin or your functions.php file in your theme. You use the add_filter() command that is part of WordPress to change the capability that allows access to each of the Subscribe2 menus.

    function s2_admin_changes( $capability, $menu ) {
        // $capability is the core WordPress capability to allow admin page access
        // $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 == 'send' ) {
            return 'read';
        }
    
        return $capability;
    }
    
    add_filter('s2_capability', 's2_admin_changes', 10, 2);
  3. saintandrews
    Member
    Posted 2 years ago #

    Thanks for responding so quickly, MattyRob, and I apologize for not checking the FAQ for this-I looked through most of the forum posts instead

  4. mattyrob
    Member
    Posted 2 years ago #

    @saintandrews,

    You are welcome - copy and paste answers are pretty quick for me so the FAQs serve a dual purpose! :)

Topic Closed

This topic has been closed to new replies.

About this Topic