Home › Forums › Front End PM PRO › Show Read Message and Announcement only for admin
- This topic has 11 replies, 2 voices, and was last updated 3 years, 10 months ago by Shamim Hasan.
-
AuthorPosts
-
January 26, 2022 at 2:15 am #44135Jan SørensenParticipant
In my setup in Function.php some guy helped me with the code for se who have read the messsage (and annomcement).
This info is not want to show to all users. Today everyone will see this info.
I want so that only admin will see these info.I am sure there is too much of the code. Can anyone help?
Here is my code today
—-
add_action( ‘init’, function(){
add_action( ‘fep_display_after_announcement’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 );
});
add_filter( ‘wpv_filter_user_query’, ‘sort_by_lastname_func’, 100, 3 );
add_filter( ‘fep_filter_message_toggle_feature’, ‘__return_false’ );add_action( ‘init’, function(){
if( fep_is_user_admin() ){
add_action( ‘fep_display_after_announcement’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 );
}
});—-
January 27, 2022 at 6:45 pm #44139Shamim HasanKeymasterPlease remove first add_action( ‘fep_display_after_announcement’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 ); line
January 28, 2022 at 4:18 am #44141Jan SørensenParticipantSorry to come back. As all users they can still see the read message. (or is it only when new message is sendt??
Here is how the code is today with still showing : Read by ……
add_action( ‘init’, function(){
});
add_filter( ‘wpv_filter_user_query’, ‘sort_by_lastname_func’, 100, 3 );
add_filter( ‘fep_filter_message_toggle_feature’, ‘__return_false’ );add_action( ‘init’, function(){
if( fep_is_user_admin() ){
add_action( ‘fep_display_after_announcement’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 );
}
});January 31, 2022 at 4:07 pm #44152Shamim HasanKeymasterDid you unchecked “Read Receipt” in Front End PM PRO > Settings > Recipient? If not, uncheck that
January 31, 2022 at 9:05 pm #44158Jan SørensenParticipantIf I do unchech that box, it will not show on message, but on announcement.
My hope was to see the Read msg AND announcement ONLY for Admin.
Is that not possible?January 31, 2022 at 11:37 pm #44161Shamim HasanKeymasterKeep unchecked that box.
Then add following line after 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 );February 2, 2022 at 4:19 pm #44164Jan SørensenParticipantThis reply has been marked as private.February 5, 2022 at 9:44 am #44173Shamim HasanKeymasterPlease recheck if you unchecked “Read Receipt” in Front End PM PRO > Settings > Recipient on both websites
February 14, 2022 at 3:28 am #44212Jan SørensenParticipantThis reply has been marked as private.February 14, 2022 at 3:14 pm #44216Shamim HasanKeymasterPlease remove all other code and then add following code. If working you can add other codes. let me know.
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 ); } });February 14, 2022 at 4:27 pm #44218Jan SørensenParticipantThis reply has been marked as private.February 14, 2022 at 7:30 pm #44220Shamim HasanKeymasterIf you remove other codes and uncheck that box and add this code, i do not see any way to show those read receipt to all users. It should show only to admins.
If you debug make sure you are not logged in as admin.
If still showing can you give me access to your website so that i can test there? If yes, please backup your site. then create 2 accounts, one as admin and another as user and send to me through https://www.shamimsplugins.com/sensitive-information/
-
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.