New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Hi Janet,
    Thank you 🙂

    If we change this line
    https://github.com/buddydev/link-page-to-groups/blob/master/link-page-to-groups.php#L77

    
    echo '<li class="bp-linked-group-page"><a href="' . get_permalink( $post ) .'">'. get_the_title( $post ).'</a></li>';
    
    

    to

    
    
    echo '<li class="bp-linked-group-page"><a href="' . get_permalink( $post ) .'" target="_blank">'. get_the_title( $post ).'</a></li>';
    

    That will always open the link in new tab on click.
    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Hi Julia,
    We are aware of the position issue with some of the themes.

    I am not sure if we can provide a quick update for this plugin. Please allow us a week to check if we can have an alternative solution.

    About the css:- It’s safe. We will remove it anyway. It is the prefixed version which is no more necessary(It was there for better browser compatibility when the plugin was released).

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Hi Zsuzsa,
    Thank you. It might be due to some other conflicts. I do plan to add a warning in future when there are duplicate slugs to avoid the issue.

    Thank you for marking it as resolved.

    Best Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Hi Shelley,
    The email templates have inline style. I will suggest copying the wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/emails directory to yourtheme(or child theme)/emails directory and modify it.

    That seems to be the best option.

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    No problem. I am glad It finally worked. I wish there was a way to filter email notification link.

  • Keymaster
    (BuddyDev Team)
    Posts: 25509
    Brajesh Singh on in reply to: [Resolved] RSS social icon #12273

    Hi Shelley,
    I am sorry for the confusion.

    Please visit Appearance > Customize > General > RSS and you will see a checkbox to disable the RSS Feed.

    Hope that helps.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    That simply means that your theme is not styling it. It should be there if you check the source. You will need to style it to look like the unordered list using css.

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Please try checking the source page. Some themes may not style it.

    Do you see the ul tag in the textarea or does it get removed on update?

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Please use the following code instead.

    
    
    /**
     * Remove groups from user profile based on member type.
     */
    function buddydev_remove_group_based_on_member_types() {
    	if ( ! bp_is_user() ) {
    		return;
    	}
    
    	$user_id = bp_displayed_user_id();
    
    	if ( ! bp_has_member_type( $user_id, 'agent' ) ) {
    		bp_core_remove_nav_item( 'groups' );
    
    		$access = bp_core_can_edit_settings();
    		$friends_link = bp_displayed_user_domain()? bp_displayed_user_domain() : bp_loggedin_user_domain();
    		$friends_link = trailingslashit( $friends_link . bp_get_friends_slug() );
    		bp_core_new_subnav_item(array(
    			'name'            => __( 'Invitations', 'buddypress' ),
    			'slug'            => 'invites',
    			'parent_url'      => $friends_link,
    			'parent_slug'     => bp_get_friends_slug(),
    			'screen_function' => 'buddydev_groups_screen_group_invites',
    			'user_has_access' => $access,
    			'position'        => 30
    		));
    		// move the invitations to the friends screen.
    	}
    }
    
    add_action( 'bp_setup_nav', 'buddydev_remove_group_based_on_member_types', 1001 );
    
    /**
     * Helps us detect screen.
     */
    function buddydev_groups_screen_group_invites() {
        add_action( 'groups_screen_group_invites', 'buddydev_load_invite_template' );
    	groups_screen_group_invites();
    }
    
    /**
     * Load our template.
     */
    function buddydev_load_invite_template() {
        add_action( 'bp_template_content', function () {
            bp_get_template_part('members/single/groups/invites');
        });
    
    	bp_core_load_template('members/single/plugins' );
    }
    
    /**
     * Change the invite link url for the non 'agent' users.
     *
     * @param string $link original link.
     *
     * @return string
     */
    function buddydev_update_group_invite_link( $link ) {
        // for agent, do not break it.
        if ( bp_has_member_type( bp_loggedin_user_id(), 'agent' ) ) {
           return $link;
        }
    
    	global $groups_template;
    
    	if ( empty( $group ) ) {
    		$group =& $groups_template->group;
    	}
    
    	$friends_url = bp_loggedin_user_domain() . bp_get_friends_slug() .'/invites/';
    	$url         = trailingslashit( $friends_url . 'accept/' . $group->id );
    	$url         = add_query_arg( array( 'redirect_to' => $friends_url  ), $url );
    
    	//
    	return wp_nonce_url( $url, 'groups_accept_invite' );
    }
    
    add_filter( 'bp_get_group_accept_invite_link', 'buddydev_update_group_invite_link' );
    
    /**
     * Change the reject link url for the non 'agent' users.
     *
     * @param string $link original link.
     *
     * @return string
     */
    function buddydev_update_group_reject_link( $link ) {
        // for agent, do not break it.
        if ( bp_has_member_type( bp_loggedin_user_id(), 'agent' ) ) {
           return $link;
        }
    
    	global $groups_template;
    
    	if ( empty( $group ) ) {
    		$group =& $groups_template->group;
    	}
    
    	$friends_url = bp_loggedin_user_domain() . bp_get_friends_slug() .'/invites/';
    	$url         = trailingslashit( $friends_url . 'reject/' . $group->id );
    	$url         = add_query_arg( array( 'redirect_to' => $friends_url ), $url );
    
    	return wp_nonce_url( $url, 'groups_reject_invite' ) ;
    }
    
    add_filter( 'bp_get_group_reject_invite_link', 'buddydev_update_group_reject_link' );
    
    /**
     * Remove groups from adminbar based on member type.
     *
     * @param array $nav nav items.
     *
     * @return array
     */
    function buddydev_filter_show_hide_groups_in_adminbar( $nav ) {
    	if ( ! is_user_logged_in() ) {
    		return $nav;
    	}
    
    	if ( ! bp_has_member_type( bp_loggedin_user_id(), 'agent' ) ) {
    		$nav = array();
    	}
    
    	return $nav;
    }
    
    add_filter( 'bp_groups_admin_nav', 'buddydev_filter_show_hide_groups_in_adminbar' );
    
    

    It will work if you try to accept from the Friends->Invites screen.

    Problem:-
    – I don’t see a way for filtering the link in the email notification.
    – You also need code for filtering the link in the local notification(atleast 2 more filters).

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25509

    Thank you for the kind words Graham.

    Your kind words mean a lot. It’s pleasure to be part of our member’s success.

    All the best.

    Regards
    Brajesh