Front End PM

Print

Add Announcement


Main difference between Message and Announcement is that user can reply to messages but cannot reply to announcements. Announcements are one way.

Sending announcement is easy as sending message.

First go to Dashboard > Front End PM > Settings > Security and check if “Add Announcement” option is checked.

Then go to Front-end (From where you send message) and click “Add Announcement” option. Then select which role(s) users will get that announcement, type subject and content and send.

By Default only Administrator role users will be able to send announcements. If you want to give permission to any other role users use following code. (Following code will allow Administrator and Editor role users to send announcements)

add_filter( 'fep_current_user_can', function( $can, $cap, $id ){
    if ( 'add_announcement' !== $cap ) {
    return $can;
    }
    if ( array_intersect( wp_get_current_user()->roles, [ 'administrator', 'editor' ] ) ) {
    return true;
    }
    return false;
}, 10, 3);