Home › Forums › Front End PM PRO › Hide Roles in Front End PM PRO – New Announcement page
- This topic has 7 replies, 3 voices, and was last updated 3 years, 7 months ago by luke.adams.
- AuthorPosts
- April 13, 2022 at 5:54 pm #44421luke.adamsParticipant
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!
LukeApril 14, 2022 at 1:53 am #44425Jan SørensenParticipantI 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;
});April 14, 2022 at 11:53 am #44431Shamim HasanKeymasterHi Luke, both options are possible.
Please see
1. https://sp-test1.arogga.co/support/topic/restrict-which-rolls-show-up-on-front-end-for-announcement/#post-25048
2. https://sp-test1.arogga.co/support/topic/create-announcements/#post-26559April 20, 2022 at 4:27 pm #44452luke.adamsParticipantThank 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’
May 1, 2022 at 10:47 pm #44482Shamim HasanKeymasterWhich code you are using to show read receipt only to admins?
May 3, 2022 at 5:51 pm #44497luke.adamsParticipantThis 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 );
}
});May 5, 2022 at 11:26 am #44506Shamim HasanKeymasterinstead of
fep_is_user_admin()usearray_intersect( wp_get_current_user()->roles, ['administrator', 'office'] )May 11, 2022 at 2:40 pm #44521luke.adamsParticipantThank you this works perfectly
- AuthorPosts
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.