Home › Forums › Front End PM PRO › Making message read-only
- This topic has 21 replies, 2 voices, and was last updated 7 years, 10 months ago by Alex Brearley.
- AuthorPosts
- January 31, 2018 at 9:41 pm #10488Alex BrearleyParticipant
Is it possible to make a message thread read-only i.e. people can read the thread but can’t reply?
January 31, 2018 at 10:40 pm #10499Shamim HasanKeymasterYou want this for only one message or all messages?
January 31, 2018 at 10:41 pm #10501Alex BrearleyParticipantone particular message – I have the parent message ID
January 31, 2018 at 10:54 pm #10503Shamim HasanKeymasterAdd following code in your theme’s (child theme’s if any) functions.php
add_filter( 'fep_current_user_can', function( $can, $cap, $id ){ if( 'send_reply' == $cap && 123 == $id ) return false; return $can; }, 10, 3);Change 123 with your parent message id
February 1, 2018 at 5:38 pm #10542Alex BrearleyParticipantThank you
February 5, 2018 at 8:23 pm #10673Alex BrearleyParticipantWhat would be best practice to hide a message entirely from a user so that they can no longer see the message thread in the inbox?
February 5, 2018 at 11:17 pm #10683Shamim HasanKeymastergo to Front End PM PRO > All Messages and find that message and change status to anything else other that publish.
February 8, 2018 at 8:32 pm #10777Alex BrearleyParticipantIs $id in the code snippet the parent/first post ID or is it the latest message post ID (won’t be parent ID if someone has replied)? What I’m looking to do is given a parent ID (the first message) make that message and all subsequent post ID’s read only.
add_filter( ‘fep_current_user_can’, function( $can, $cap, $id ){
if( ‘send_reply’ == $cap && 123 == $id )
return false;return $can;
}, 10, 3);February 9, 2018 at 12:53 am #10805Shamim HasanKeymasterit will parent id (first message id of the thread).
February 9, 2018 at 9:51 pm #10891Alex BrearleyParticipantI’m getting a PHP warning saying that I’m missing argument 2 and 3 in that filter hook. Are you sure there are 3 parameters?
February 9, 2018 at 10:35 pm #10901Shamim HasanKeymasterwhich version of this plugin you are using?
February 10, 2018 at 12:55 am #10910Alex BrearleyParticipantv7.1
February 10, 2018 at 1:48 am #10913Shamim HasanKeymasterThis has 3 arguments.
Can you please give me exact code what you have added and where added?February 15, 2018 at 1:23 am #11053Alex BrearleyParticipantThis reply has been marked as private.February 15, 2018 at 2:10 am #11056Shamim HasanKeymasterYou have missed ‘send_reply’ part. Please add
if( 'send_reply' !== $cap ) return $can;after line 76
also write 10 and 3 as integer (without single quote). You can see functions.php of this plugin for this hook, this hook is passing 3 arguments.
- 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.