Reply To: Resctrict private messages
Hi, thread_id is from the buddypress. When a message is going for save bp checks if there’s a thread id, if not it’s because that is the first message.
Anyway, i got it to kind of work. Used some info from the other thread. I use the add_filter() to check if the user has a membership and if not, take out the button. Also i was forgeting to include the file with the Paid membership function. Here’s the code:
add_filter( 'bp_get_send_message_button', function( $array ) {
if ( pmpro_hasMembershipLevel('Premium') ) {
return $array;
} else {
return '';
}
} );
If you have any recommendations for this i’ll be glad to follow.