BuddyDev

Search

[Resolved] Private Message Rate Limiter & Verified Member

  • Participant
    Level: Initiated
    Posts: 6
    Mary Pearson on #55271

    I have just installed BP Private Message Rate Limiter and BP Verified Member plugins. I would like the rate limiter to be deactivated for all verified members.

    Can you tell me how to accomplish this please.
    Thank you.

  • Keymaster
    (BuddyDev Team)
    Posts: 24896
    Brajesh Singh on #55277

    Hi Mary,
    Thank you for using the plugin.
    I am sorry for the delayed reply.

    1. Please upgrade to 1.1.4 and then ad the following code to your child theme’s functions.php or wp-content/plugins/bp-custom.php

    
    
    /**
     * Disables private message rate limiter for verified members
     */
    add_filter( 'bp_private_message_rate_limiter_can_send', function ( $can, $user_id ) {
    	global $bp_verified_member;
    	if ( ! $bp_verified_member || ! is_callable( array( $bp_verified_member, 'is_user_verified' ) ) ) {
    		return $can;
    	}
    
    	if ( $bp_verified_member->is_user_verified( $user_id ) ) {
    		$can = true;
    	}
    
    	return $can;
    }, 10, 2 );
    
    

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 6
    Mary Pearson on #55279

    Many, many thanks! This is exactly what I need. Much appreciated!

  • Keymaster
    (BuddyDev Team)
    Posts: 24896
    Brajesh Singh on #55281

    You are welcome. I am glad it helped.

The topic ‘ [Resolved] Private Message Rate Limiter & Verified Member’ is closed to new replies.

This topic is: resolved