BuddyBoss Home – Web › Support Forums › Plugins › BuddyBoss Wall › Deleted User Bug
- This topic has 5 replies, 2 contibutors, and was last updated 9 years, 1 months ago by Anonymous.
Question
September 29, 2015 at 4:16 am #47429@louboulosJust a suggestion.
I think this should be fixed.
I deleted a user and this appeared in the Activity pageAnswers
September 29, 2015 at 9:04 am #47443@
Anonymoushi @louboulos
Thanks for the suggestion, That string is added in BuddyBoss Wall plugin
BuddyPress itself do not post any name there
Regards
Varun DubeySeptember 30, 2015 at 2:15 am #47516@louboulosok a wall plugin bug then.
Just something I think should get fixed 🙂
September 30, 2015 at 12:12 pm #47584@
AnonymousHi @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 accountbuddyboss_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 DubeyOctober 1, 2015 at 12:12 am #47651@loubouloswhy would someone want that, is beyond my understanding.. :/
October 1, 2015 at 11:33 am #47701@
AnonymousHi @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
- The question ‘Deleted User Bug’ is closed to new replies.