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 4 posts - 1 through 4 (of 4 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!

    #45375

    hi, i have the same problem.

    where and what have i to put that code for user role contributor??

    thx

    #45379
    Shamim Hasan
    Keymaster

    You can follow https://www.shamimsplugins.com/support/topic/create-announcements/#post-26559

    But will be tricky to only to the users he/she currently has messages with. This needs to be custom coded (if possible).

Viewing 4 posts - 1 through 4 (of 4 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.