Viewing 6 posts - 1 through 6 (of 6 total)
  • Question

    #47429
    @louboulos

    Just a suggestion.
    I think this should be fixed.
    I deleted a user and this appeared in the Activity page

    Answers

    #47443

    Anonymous
    @

    hi @louboulos
    Thanks for the suggestion, That string is added in BuddyBoss Wall plugin
    BuddyPress itself do not post any name there
    Regards
    Varun Dubey

    #47516
    @louboulos

    ok a wall plugin bug then.

    Just something I think should get fixed 🙂

    #47584

    Anonymous
    @

    Hi @louboulos, It’s not a Bug.

    It is included intensely after several request of users
    = 1.0.4 =
    * Now displaying ‘Deleted User’ text in activity post if user deletes account

    buddyboss_wall_replace_placeholders_with_url() contain that string

    it will need to removed existing filter and add new function for buddyboss_wall_replace_placeholders_with_url()
    Regards
    Varun Dubey

    #47651
    @louboulos

    why would someone want that, is beyond my understanding.. :/

    #47701

    Anonymous
    @

    Hi @louboulos

    You can add following function to your child theme functions.php to remove it

    
    function deleted_user_activity() {
      global $bp;
     remove_filter( 'bp_get_activity_action', 'buddyboss_wall_replace_placeholders_with_url', 11, 2 );
      add_filter( 'bp_get_activity_action', 'buddyboss_wall_replace_placeholders_with_url_modified', 11, 2 );
    			
    }
    add_action('bp_init', 'deleted_user_activity');
    
    function buddyboss_wall_replace_placeholders_with_url_modified( $action, $activity ){
    
    	if( 1==1 ){
    		$initiator_id = bp_activity_get_meta($activity->id, 'buddyboss_wall_initiator', true);
    		$target_id = bp_activity_get_meta($activity->id, 'buddyboss_wall_target', true);
    
    		// replace %INITIATOR% with userlink/You
    		if( is_user_logged_in() && bp_loggedin_user_id()==$initiator_id ){
    			$action = str_replace( '%INITIATOR%', __( 'You', 'buddyboss-wall' ), $action);
    		}
    		else{
    			$initiator_name = bp_core_get_user_displayname( $initiator_id );
    			/*
    			 * a quick workaround to check if the user in question is still valid/account not deleted.
    			 * Although, activity entries posted by a, now deleted user, dont show up on activity stream.
    			 * Just to be on safe side.
    			 */
    			if( $initiator_name ){
    				$initiator_profile_link = '<a href="'. esc_url( bp_core_get_user_domain( $initiator_id ) ) .'" title="' . esc_attr( $initiator_name ) . '">'. $initiator_name .'</a>';
    			}
    			else{
    			//	$initiator_profile_link = __( '', 'buddyboss-wall' );
    			}
    
    			$action = str_replace( '%INITIATOR%', $initiator_profile_link, $action);
    		}
    
    		// replace %TARGET% with userlink/your
    		if( is_user_logged_in() && bp_loggedin_user_id()==$target_id ){
    			$action = str_replace( '%TARGET%', __( 'your', 'buddyboss-wall' ), $action);
    		}
    		else{
    			$target_name = bp_core_get_user_displayname( $target_id );
    			/*
    			 * a quick workaround to check if the user in question is still valid/account not deleted
    			 */
    			if( $target_name ){
    				if ( substr( $target_name, -1 ) === 's' ){
    					$target_possesive_fullname = sprintf( __( "%s'", 'buddyboss-wall' ), $target_name );
    				}
    				else {
    					$target_possesive_fullname = sprintf( __( "%s's", 'buddyboss-wall' ), $target_name );
    				}
    
    				$target_profile_link = '<a href="'. esc_url( bp_core_get_user_domain( $target_id ) ) .'" title="' . esc_attr( $target_name ) . '">'. $target_possesive_fullname .'</a>';
    			}
    			else{
    				$target_profile_link = __( "", "buddyboss-wall" );
    			}
    			$action = str_replace( '%TARGET%', $target_profile_link, $action);
    		}
    	}
    
    	return $action;
    }
    
    

    Regards
    Varun Dubey

Viewing 6 posts - 1 through 6 (of 6 total)
  • The question ‘Deleted User Bug’ is closed to new replies.