Alex Brearley
Forum Replies Created
-
AuthorPosts
-
Alex BrearleyParticipant
Made those changes – no change. The php error is specifically on line 75 where the function is called by the hook – still thinks there should be 1 not 3. I tried:
public function cmdu_read_only_message($can)
//public function cmdu_read_only_message($can, $cap, $id){
print_r($can);
die();And the result was 1
Alex BrearleyParticipantThis reply has been marked as private.Alex BrearleyParticipantv7.1
Alex 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?
Alex 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);Alex 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?
Alex BrearleyParticipantThank you
Alex BrearleyParticipantone particular message – I have the parent message ID
January 20, 2018 at 11:13 pm in reply to: Muliple recipients in fep_shortcode_new_message_form shortcode #10051Alex BrearleyParticipantThank you – I will give this code snippet a go.
Out of interest, is it possible to use the fep_filter_message_before_send filter to also halt/abort creation of the message by manipulating the variables within its scope? I am wondering if I could within this filter check that something related to my app is correct and if not abort creation of the message.
Alex BrearleyParticipantThanks for this – I have indeed not set the Display Name for each user – it has defaulted to their user name. I will find an appropriate hook to change that on registration.
January 19, 2018 at 12:26 pm in reply to: Muliple recipients in fep_shortcode_new_message_form shortcode #10022Alex BrearleyParticipantSo basically, change $message_to_id to an array of user ids. Do I need to return $message_to_id from the function or is it just enough to change it? Are there 3 parameters on _before_send like there are on after_send?
I presume that once multiple participants have been added, any future replies will go to everyone i.e. if I send the first message to two people, if one of those 2 people respond, I receive it and the other person from the 2 receive it? Or, is it the case that the _before_send hook has to everytime a reply is sent, work out the to list?
January 18, 2018 at 10:52 pm in reply to: Muliple recipients in fep_shortcode_new_message_form shortcode #10013Alex BrearleyParticipantIf the shortcode does not support multiple users in to, would it be possible to add the users using the fep_action_message_after_send hook i.e. insert post_meta data to add that particular message ID to other users inbox?
Alex BrearleyParticipantThank you ever so much for your help 🙂
Alex BrearleyParticipantAs a suggestion, would you be open to updating the shortcode to accept post_meta values?
For example:
fep_shortcode_new_message_form to=”{current-post-author}” subject=”{current-post-title}” post_meta=”id,12345678″]
Alex BrearleyParticipantsorry, our messages overlapped – thanks for your help I will give that a go
-
AuthorPosts