Message restriction

Hi, i would like to exclude vendors from the message restriction (so that only Membership buy subscription to chat with message vendors). Thanks in advance if you have a simple code snippet for this.

Emmanuelle

Please try this PHP snippet

add_filter( 
	'hivepress/v1/components/request/context', 
	function($context) {
		if(current_user_can('edit_posts') && !isset($context['membership'])){
			$context['membership'] = ( new HivePress\Models\Membership() )->fill( ['message' => true] );
		}
		
		return $context;
	},
	1000
);

Thank you !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.