Viewing 4 replies - 1 through 4 (of 4 total)
  • @barrydocks,

    By default this feature is restricted to users with a role of Author and above. If you want to restrict it further create your own little plugin with this code, it will restrict to to admins only.

    function s2_admin_changes( $capability, $menu ) {
        if ( $menu == 'send' ) {
            return 'manage_options';
        }
        return $capability;
    }
    
    add_filter('s2_capability', 's2_admin_changes', 10, 2);

    There’s a little more detail on that code in the FAQs.

    Thread Starter barrydocks

    (@barrydocks)

    @mattyrob

    Thanks for this. I have tryied it but get the following error after installing the plugin:

    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 697
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 698
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 699
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 700
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 701
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 702
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 705
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 706
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 707
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 708
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 711
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 712
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 713
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 714
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/wp-activity/wp-activity.php on line 306
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/sites/o/oculuscura.co.uk/public_html/wp-content/plugins/subcribe2_stop_bulk_email/subscribe2_stop_bulk_email.php:21) in /var/sites/o/oculuscura.co.uk/public_html/wp-includes/pluggable.php on line 881

    Here is the plugin code:

    <?php
       /*
       Plugin Name: Subscribe2_stop_bulk_email
       Plugin URI: https://my-awesomeness-emporium.com
       Description: Subscribe2 - Prevent users from sending bulk e-mails
       Version: 1.0
       Author: Adrian
       Author URI: https://mrtotallyawesome.com
       License: GPL2
       */
    function s2_admin_changes( $capability, $menu ) {
        if ( $menu == 'send' ) {
            return 'manage_options';
        }
        return $capability;
    }
    
    add_filter('s2_capability', 's2_admin_changes', 10, 2);
    ?>

    I suspect it is more due to my lack of php coding skill, please could you suggest an amendment to will make it work??!!

    @barrydocks,

    That code looks fine to me, I even pasted it into a file and tested it myself and it worked fine – no errors on activation or anywhere that I could find on my site.

    It might be a character encoding issue so try pasting the code from above back into your plugin file and see if that helps.

    Thread Starter barrydocks

    (@barrydocks)

    @mattyrob

    Thanks, all working now!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Subscribe2] prevent users from sending bulk e-mail’ is closed to new replies.