Allow author user role to send announcement, but only to certain contacts


Home Forums Front End PM PRO Allow author user role to send announcement, but only to certain contacts

This topic is: Resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43358
    lia.spoerl
    Participant

    Hi,

    I’d like the author user role to be able to send announcements, but only to the users he/she currently has messages with (so that user can’t send announcements to everybody on my site).

    Is that possible at all?

    Thanks

    #43371

    This works for me:

    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_02’, ‘urednik’, ‘administrator’ ] ) ) {
    return true;
    }
    return false;
    }, 10, 3);

    Have a nice day!

Viewing 2 posts - 1 through 2 (of 2 total)

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.