BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Nifty,

    Sorry for the delayed reply. I have updated the plugin BP Private Message Rate Limiter and BuddyPress Block Users please upgrade and give it a try.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Nifty,

    You are right with legacy both blocker and blocked user can start new conversation with each other. I am going to fix this today and will update you soon.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Nifty,

    Thank you for sharing the screenshots. I will check it again and will update you soon.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Nifty,

    I have tried to create this issue on my development server but I am unable to create this. Can you please share a short video of the issue and how are you creating this so that I can check then fix it.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Whatsapp me Button #47812

    Hello

    Welcome to the BuddyDev forums. Please try the following way:

    
    
    function buddydev_add_custom_buttons( $buttons ) {
    
    	if ( ! bp_is_user() || bp_is_my_profile() ) {
    		return $buttons;
    	}
    
    	if ( ! bp_is_active( 'xprofile' ) ) {
    		return $buttons;
    	}
    
    	// Replace field id with your phone number field id.
    	$phone_number = xprofile_get_field_data( 28, bp_displayed_user_id(), 'string' );
    
    	// You can also validate weather phone number valid or not.
    	if ( $phone_number ) {
    		$buttons['contact'] = array(
    			'id'                => 'buddydev_contact',
    			'component'         => 'members',
    			'must_be_logged_in' => true,
    			'button_element'    => 'a',
    			'link_text'         => __( 'Contact me' ),
    			'button_attr'       => array(
    				'href'  => esc_url( "https://wa.me/{$phone_number}" ),
    				'title' => __( 'Contact Me' ),
    			)
    		);
    	}
    
    	return $buttons;
    }
    
    add_filter( 'bp_nouveau_get_members_buttons', 'buddydev_add_custom_buttons' );
    
    

    Please let me know if it helps or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Hide the bp type box and mpp on website 2 #47810

    Hello Daniel,

    I have modified the template on your production site. You can check in your child theme directory under /buddypress/activity/index.php file. You can move the same file to the staging server to debug further.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Emmanuel,

    Welcome to the BuddyDev Forums. Please try the following code in your ‘bp-custom.php’ file and let me know if it helps or not

    
    /**
     * Redirects site members to specific page if trying to access restricted pages.
     */
    function buddydev_redirect_members_from_restricted_pages() {
        $current_page_id = get_queried_object_id();
    
        if ( ! $current_page_id ) {
            return;
        }
    
        // Page id you want to redirect logged-in users. Replace with your page id.
        $redirection_page_id = 2;
        // Restricted page ids for logged-in users. Replace with your page ids.
        $restricted_page_ids = array( 5, 32, 6 );
    
        if ( in_array( $current_page_id, $restricted_page_ids ) && ! is_page( $redirection_page_id ) ) {
            bp_core_redirect( get_permalink( $redirection_page_id ) );
        }
    }
    
    /**
     * Redirects site visitors to login page if trying to access restricted pages.
     */
    function buddydev_redirect_visitors_from_restricted_pages() {
    
        $current_page_id = get_queried_object_id();
    
        if ( ! $current_page_id ) {
            return;
        }
    
        // do not restrict the signup, activation and login pages
        if ( bp_is_register_page() || bp_is_activation_page() || ( function_exists('is_login') && is_login() ) ) {
            return;
        }
    
        // Restricted page ids for visitors. Replace with yours page ids.
        $restricted_page_ids = array( 29, 30 );
    
        if ( in_array( $current_page_id, $restricted_page_ids ) ) {
            $redirect_url = get_permalink( $current_page_id );
            bp_core_redirect( wp_login_url( $redirect_url ) );
        }
    }
    
    add_action( 'bp_template_redirect', function () {
        // assuming that you are trying to protect 'pages' not other content.
        if ( ! is_page() ) {
            return;
        }
    
         if ( is_user_logged_in() ) {
            buddydev_redirect_members_from_restricted_pages();
        } else {
            buddydev_redirect_visitors_from_restricted_pages();
        }
    } );
    
    

    Note: Replace the page ids with yours

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Lefteris,

    With that number of users you can use the code. Please let me know if works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Hide the bp type box and mpp on website 2 #47780

    Hello Daniel,

    Thank you, Please let me know how it goes?

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Lefteris,

    Sorry for the delayed reply. Code seems to be work fine but it is very inefficient with large user base. So, If you want we can provide you an efficient way of doing this just tell how many users you are dealing with.

    Regards
    Ravi