Show Read Message and Announcement only for admin


Home Forums Front End PM PRO Show Read Message and Announcement only for admin

This topic is: Not Resolved
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #44135
    Jan Sørensen
    Participant

    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 );
    }
    });

    —-

    #44139
    Shamim Hasan
    Keymaster

    Please remove first add_action( ‘fep_display_after_announcement’, array( Fep_Read_Receipt::init(), ‘display_read_receipt’ ), 99 ); line

    #44141
    Jan Sørensen
    Participant

    Sorry 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 );
    }
    });

    #44152
    Shamim Hasan
    Keymaster

    Did you unchecked “Read Receipt” in Front End PM PRO > Settings > Recipient? If not, uncheck that

    #44158
    Jan Sørensen
    Participant

    If 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?

    #44161
    Shamim Hasan
    Keymaster

    Keep 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 );
    
    #44164
    Jan Sørensen
    Participant
    This reply has been marked as private.
    #44173
    Shamim Hasan
    Keymaster

    Please recheck if you unchecked “Read Receipt” in Front End PM PRO > Settings > Recipient on both websites

    #44212
    Jan Sørensen
    Participant
    This reply has been marked as private.
    #44216
    Shamim Hasan
    Keymaster

    Please 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 );
        }
    });
    
    #44218
    Jan Sørensen
    Participant
    This reply has been marked as private.
    #44220
    Shamim Hasan
    Keymaster

    If 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/

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