Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove Activity / Join Info

  • @billmann

    Participant

    Is there an easy way to remove the “joined 1 year, 4 months ago” and the “active 1 month, 2 weeks ago” that is displayed in Buddypress? We would like to remove any instance of these types of notifications.

    Thanks in advance with any input on how to achieve this.

Viewing 1 replies (of 1 total)
  • @danbp

    Participant

    hi @billmann,

    to remove only last activity date from profile header:

    function bpfr_core_get_last_activity( $last_activity_date ) {
       if ( empty( $last_activity_date ) )
          // we do nothing
             $last_active = '';
       else
       $last_active = sprintf( $string, bp_core_time_since( $last_activity_date ) );
     }
    add_filter( 'bp_core_get_last_activity', 'bpfr_core_get_last_activity' );

    To remove all last active instance (profile, group & member directory,…), you simply remove the filter

    
    function bpfr_remove_last_activity_filter() {
        remove_filter( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
    }
    add_filter( 'bp_core_get_last_activity', 'bpfr_remove_last_activity_filter' );

    Add to your child-theme functions.php or to bp-custom.php

    bp_core_get_last_activity function is in buddypress/bp-core/bp-core-functions.php:1418

    Note that site wide activity is not affected by these functions.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove Activity / Join Info’ is closed to new replies.
Skip to toolbar