Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can i hide new registered member update, from activity streams?


  • hammed4real101
    Participant

    @hammed4real101

    please how can i hide the new registered member update, from activity streams?

    Have tried to use the BuddyPress Block Activity Stream Types, but it not working.

    Please i need urgent assistance.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

  • Henry Wright
    Moderator

    @henrywright

    Hi @hammed4real101

    You should be able to do this:

    remove_action( 'bp_core_activated_user', 'bp_core_new_user_activity' );


    hammed4real101
    Participant

    @hammed4real101

    @henry wright

    please am not a pro developer yet, am still learning.

    please, explain the steps to get that done.

    am using a wordpress theme. Thanks


    Henry Wright
    Moderator

    @henrywright

    Just copy and paste it into your theme’s functions.php file.


    danbp
    Moderator

    @danbp

    hi @henrywright. Oooooooooooups ! No pasaran. 😉

    @hammed4real101,

    try this (add to child-theme functions.php or bp-custm.php) :

    function swa_remove_new_member_activity( $a, $activities ) {
     
    	//allow site admin to see
    	if ( is_site_admin() )
    		return $activities;
     
    	foreach ( $activities->activities as $key => $activity ) {
    		// activity type name is new_member
    		if ( $activity->type =='new_member') {
    		unset( $activities->activities[$key] );
    		 
    				// recalculate activity items for pagination
    				$activities->activity_count = $activities->activity_count-1;
    				$activities->total_activity_count = $activities->total_activity_count-1;
    				$activities->pag_num = $activities->pag_num -1;
    		}
    	}
     
    	// Renumber the array keys to account for missing items 
    	$activities_new = array_values( $activities->activities );
    	$activities->activities = $activities_new;
    	
    	// output
    	return $activities;
    }
    add_action('bp_has_activities','swa_remove_new_member_activity', 10, 2 );

    hammed4real101
    Participant

    @hammed4real101

    @henrywright @danbp

    thanks guys, it works.


    danbp
    Moderator

    @danbp

    FYI, so things be clear for every case.

    Henry’s snippet works only for upcoming new_member.
    The other snippet hides new and existing new_member.


    Henry Wright
    Moderator

    @henrywright

    @danbp thanks for adding to make a full solution 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How can i hide new registered member update, from activity streams?’ is closed to new replies.
Skip to toolbar