WordPress.org

Ready to get started?Download WordPress

Forums

Email Users
[resolved] Hide "Notify" command when user has no "notify" capability (6 posts)

  1. dcclxi
    Member
    Posted 2 years ago #

    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/

  2. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    I agree and have changed this in 4.3.2.

  3. dcclxi
    Member
    Posted 2 years ago #

    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?

  4. dcclxi
    Member
    Posted 2 years ago #

    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?

  5. Mike Walsh
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  6. dcclxi
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic