Skip to:
Content
Pages
Categories
Search
Top
Bottom

Filter activity action


  • graeme_bryson
    Participant

    @graeme_bryson

    I’m looking to filter the activity item to remove ‘posted an update’, so that it only states the user’s display name with ‘time-since’ breaking onto the next line.

    I found this snippet by Boone, but I’m struggling to make it work and so far have only managed to strip out the post meta entirely with te exception of ‘said:’ – any help would be massively appreciated.

    
    function my_format_activity_action($activity_action, $post_id, $post_text, &$topic) {
    $action = $post_text->topic_poster_name . " said:";
    return $action;
    }
    add_filter( 'groups_activity_new_forum_topic_action', 'my_format_activity_action', 1, 4 );
Viewing 1 replies (of 1 total)

  • Skyrie
    Participant

    @skyrie

    @graeme_bryson and for anyone else who wants to know, this code should work!

    function my_activity_posted_by_action( $action, $activity ) {
    	$action = sprintf( __( '%s', 'buddypress' ), bp_core_get_userlink( $activity->user_id ) );
    	return $action;
    }
    add_filter( 'bp_activity_new_update_action', 'my_activity_posted_by_action', 1, 2 );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar