Build online communities, sell courses & memberships on WordPress Support Forums Plugins BuddyBoss Wall Can I control what shows up on the activity feed

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

    #64143
    @thood

    Just wondering if i can stop the activity feed to show when a new user becomes a registered member?
    i.e. User became a registered member 3 hours,44 minutes ago

    Answers

    #64229

    Anonymous
    @

    Hi @thood, Please add this function:

    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 );
    

    Regards

    #65915
    @thood

    i Inserted the code into function.php after inserting my webpage crashed.

    <?php
    /**
    * @package Boss Child Theme
    * The parent theme functions are located at /boss/buddyboss-inc/theme-functions.php
    * Add your own functions in this file.
    */

    /**
    * Sets up theme defaults
    *
    * @since Boss Child Theme 1.0.0
    */
    function boss_child_theme_setup()
    {
    /**
    * Makes child theme available for translation.
    * Translations can be added into the /languages/ directory.
    * Read more at: https://www.buddyboss.com/tutorials/language-translations/
    */

    // Translate text from the PARENT theme.
    load_theme_textdomain( ‘boss', get_stylesheet_directory() . ‘/languages' );

    // Translate text from the CHILD theme only.
    // Change ‘boss' instances in all child theme files to ‘boss_child_theme'.
    // load_theme_textdomain( ‘boss_child_theme', get_stylesheet_directory() . ‘/languages' );

    }
    add_action( ‘after_setup_theme', ‘boss_child_theme_setup' );

    /**
    * Enqueues scripts and styles for child theme front-end.
    *
    * @since Boss Child Theme 1.0.0
    */
    function boss_child_theme_scripts_styles()
    {
    /**
    * Scripts and Styles loaded by the parent theme can be unloaded if needed
    * using wp_deregister_script or wp_deregister_style.
    *
    * See the WordPress Codex for more information about those functions:
    * http://codex.wordpress.org/Function_Reference/wp_deregister_script
    * http://codex.wordpress.org/Function_Reference/wp_deregister_style
    **/

    /*
    * Styles
    */
    wp_enqueue_style( ‘boss-child-custom', get_stylesheet_directory_uri().'/css/custom.css' );
    }
    add_action( ‘wp_enqueue_scripts', ‘boss_child_theme_scripts_styles', 9999 );

    /****************************** CUSTOM FUNCTIONS ******************************/

    // Add your own custom functions here
    this is where i inserted the code
    ?>

    #65917
    @thood

    i deleted the code by refreshing the previous page and cuting out the code but it didnt work. Can i just go to my server and replace this file with the correct version of function.php

    #65947
    @vapvarun

    Hi @thood
    Sorry for inconvenience.
    Please remove the extra codes you have added inside child theme functions.php and it will be live.

    Regards

Viewing 5 posts - 1 through 5 (of 5 total)
  • The question ‘Can I control what shows up on the activity feed’ is closed to new replies.