BuddyDev

Search

Customize private group announcement

Tagged: 

  • Participant
    Level: Master
    Posts: 152
    Hugo Callens on #26037

    When you arrive at a private group’s home page you get the message “This is a private group. To join you must be a registered site member and request group membership.”

    Is there a way to customize this message on a per group basis?

  • Keymaster
    (BuddyDev Team)
    Posts: 21801
    Brajesh Singh on #26041

    Hi Hugo,

    Thank you for the question.

    I do not see a simple way to customize it on per group basis.

    There are two ways to customize it.
    1. Using the filter ‘bp_group_status_message’ or
    2. Modifying buddypress/groups/single/home.php in your theme.

    Here is an example using the filter.

    
    
    function buddydev_custom_group_status_message( $message, $group ) {
    
    	if ( 'private' !== $group->status ) {
    		return $message;
    	}
    
    	// now handle all the cases(invited, pending etc) and modify the $message
    
    	return $message;
    }
    
    add_filter( 'bp_group_status_message', 'buddydev_custom_group_status_message', 10, 2 );
    
    

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved