Support » Plugin: Email Users » [Plugin: Email Users] Hide "Notify" command when user has no "notify" capability

  • Resolved dcclxi

    (@dcclxi)


    Just a little suggestion.

    Authors by default don’t have the capability to notify others about posts and pages. For this reason, it seems better if they couldn’t even access the Notify command from the dashboard (Posts > Notify, and Pages > Notify).

    Perhaps this isn’t the best way to do it, but this code change hides this command in email-users.php:

    // replaced MAILUSERS_EMAIL_SINGLE_USER_CAP by MAILUSERS_NOTIFY_USERS_CAP
    
    add_posts_page(
    	__('Notify Users', MAILUSERS_I18N_DOMAIN),
    	__('Notify Users', MAILUSERS_I18N_DOMAIN),
    	MAILUSERS_NOTIFY_USERS_CAP,
           	'mailusers-send-notify-mail-post',
           	'mailusers_send_notify_mail') ;
    
    // replaced MAILUSERS_EMAIL_SINGLE_USER_CAP by MAILUSERS_NOTIFY_USERS_CAP
    
    add_pages_page(
    	__('Notify Users', MAILUSERS_I18N_DOMAIN),
    	__('Notify Users', MAILUSERS_I18N_DOMAIN),
    	MAILUSERS_NOTIFY_USERS_CAP,
           	'mailusers-send-notify-mail-page',
           	'mailusers_send_notify_mail') ;

    http://wordpress.org/extend/plugins/email-users/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Walsh

    (@mpwalsh8)

    I agree and have changed this in 4.3.2.

    Great, thanks a lot!

    By the way, still about notifications. There is a typo in the user profile preferences part: “receive”, not “recieve”.

    Are you interested in a French translation for your plugin?

    And I meant to make another suggestion as well. I actually don’t want my users to decide on whether they agree to receive notifications or mass mails. The first one is because I use MailPress to let them know about new posts and articles. The second one is because they actually asked to be able to e-mail one another via the website.
    Would it be possible to have an option on the admin side to decide whether or not the two user preferences checkboxes are shown?

    Plugin Author Mike Walsh

    (@mpwalsh8)

    That option is pretty simple to I just implemented it and you can see it in the 4.3.3 update. There is another checkbox in the “Default User Settings” section of the Options page.

    I also fixed the typos and I am open to translations although I don’t know much about how they are added to a plugin. I have just recently started contributing to this plugin after using it for a number of years and contributing some patches to it.

    Thanks a lot for the code change! It’s exactly what I meant. I’m afraid though the typo spread to the changes you just made to the admin (where I can tick whether users should be able to choose whether they receive notifications, etc. or not).

    About the translation, I’m not an expert either, but your plugin seems already coded to accept translations. Each time you find “MAILUSERS_I18N_DOMAIN” in the code, the corresponding string is available for translation. I’m using another plugin to do translation: http://wordpress.org/extend/plugins/codestyling-localization/.

    That plugin created for me the template translation file: wp-content/plugins/email-users/email-users-xx_XX.pot. Then I added the French language, translated half of the strings (haven’t done them all yet) and the plugin created an email-users-fr_FR.mo and an email-users-fr_FR.po automatically. They get picked up automatically and I see your plugin in French. I don’t know whether there is more to it to be honest.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Email Users] Hide "Notify" command when user has no "notify" capability’ is closed to new replies.