Hide Roles in Front End PM PRO – New Announcement page


Home Forums Front End PM PRO Hide Roles in Front End PM PRO – New Announcement page

This topic is: Resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #44421
    luke.adams
    Participant

    Afternoon,

    I recently upgraded to front end pm pro and was wondering if any of the following was possible:

    1. I was wondering if there was a way to hide specific roles in the New Announcement page. For example, I would like to hide the option for Administrator

    2. Is there a way to allow another user role to send announcements on top of the admin?

    Any help would be greatly appreciated

    Thanks!
    Luke

    #44425
    Jan Sørensen
    Participant

    I have just put the code into Functions.php and it works exellent:

    }

    add_filter( ‘fep_get_all_groups’, function( $groups ){
    if( ! fep_is_user_admin() ){
    unset( $groups[ 2289 ] );
    }
    return $groups;
    });

    #44431
    Shamim Hasan
    Keymaster
    #44452
    luke.adams
    Participant

    Thank you for this they both work perfectly.

    I currently have it so only admins can see read receipts on the announcements however, i would like to open this up to another user role is this possible?

    The user role would be ‘office’

    #44482
    Shamim Hasan
    Keymaster

    Which code you are using to show read receipt only to admins?

    #44497
    luke.adams
    Participant

    This is the code I am currently using. It only shows the read receipts to admins however I would like for user group ‘office’ to be able to see them too

    //Front End PM Code – Only shows Admins Read receipts
    add_action( ‘init’, function(){
    if( fep_is_user_admin() ){
    add_action( ‘fep_display_after_announcement’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 );
    add_action( ‘fep_display_after_message’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 );
    }
    });

    #44506
    Shamim Hasan
    Keymaster

    instead of fep_is_user_admin() use array_intersect( wp_get_current_user()->roles, ['administrator', 'office'] )

    #44521
    luke.adams
    Participant

    Thank you this works perfectly

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