WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
"Send Email" only for Admins? (4 posts)

  1. BRotondi
    Member
    Posted 2 years ago #

    I don't like it, that everyone can send emails to everyone. Is there a way I can prevent this?

    Or can I at least take the top option "All registered Users (.)" out of the pulldown?

    Thanks!
    Bruno

    http://wordpress.org/extend/plugins/subscribe2/

  2. BRotondi
    Member
    Posted 2 years ago #

    (a simple workaround: Edit the plugin and comment the following line:

    add_submenu_page('s2', __('Send Email', 'subscribe2'), __('Send Email', 'subscribe2'), apply_filters('s2_capability', "publish_posts", 'send'), 's2_posts', array(&$this, 'write_menu'));

  3. mattyrob
    Member
    Posted 2 years ago #

    @BRotondi,

    By default any user who can publish a post can access this screen. If you want to restrict that to higher level users you can of course edit the code or you could use the filter that's already built in. This should work to restrict the Send Email menu to administrators only

    function s2_admin_changes( $capability, $menu ) {
        if ( $menu == 'send' ) {
            return 'update_core';
        }
    
        return $capability;
    }
    
    add_filter('s2_capability', 's2_admin_changes', 10, 2);
  4. BRotondi
    Member
    Posted 2 years ago #

    Thanks for the code!

    Bruno

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags