Join our new community forum for support & discussion

Join Now

Home Support Extensions Memberships Restrict messages – Except for exciting threads in Dashboard

Restrict messages – Except for exciting threads in Dashboard

  • Author
    Posts
  • Aurelien

    When restricting messages to All users, only users with a Membership can send messages.

    In my case, vendors should not need a membership to reply messages they receive in their dashboard.

    Can you tell me what code to modify so that it will not restrict sending message from the Dashboard if user has no membership ?

    Thanks.

    yevhen developer

    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
    );
    Aurelien

    it is working !
    thanks

Viewing 3 posts - 1 through 3 (of 3 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.