Reply To: Urgent – Disable design feature in code or via backend ( Group messages killed )


Home Forums Front End PM PRO Urgent – Disable design feature in code or via backend ( Group messages killed ) Reply To: Urgent – Disable design feature in code or via backend ( Group messages killed )

#21014
Shamim Hasan
Keymaster

Add following code in your theme’s (child theme’s if you are using) functions.php

add_filter( 'fep_current_user_can', function( $can, $cap, $id ){
	if( 'send_reply' !== $cap || $can ) {
		return $can;
	}
	if( ! is_user_logged_in() || fep_is_user_blocked() ) {
		return $can;
	}
	if( ! $id || fep_get_message_status( $id ) !== 'publish' ) {
		return $can;
	}
	if ( in_array( get_current_user_id(), fep_get_participants( $id ) ) ) {
		$can = true;
	}

	return $can;
}, 10, 3);