Skip to:

Editing items displayed by bp_activity_action()

  • I want to add some html tags around the avatar on the code below:


    <img class="avatar user-2-avatar" width="20" height="20" title="polokina" alt="Profile picture of
    polokina” src=””>
    are now friends

    3 days, 20 hours ago


    I found out that the above code(sans the “div”) is displayed by bp_activity_action(). in activity/entry.php. And that function, which is defined in bp_activity/bp_activity_template.php, merely echoes another function

    `function bp_activity_action() {
    echo bp_get_activity_action();

    and bp_get_activity_action() is defined as follows:

    `function bp_get_activity_action() {
    global $activities_template;

    $action = $activities_template->activity->action;
    $action = apply_filters_ref_array( ‘bp_get_activity_action_pre_meta’, array( $action, &$activities_template->activity ) );

    if ( !empty( $action ) )
    $action = bp_insert_activity_meta( $action );

    return apply_filters_ref_array( ‘bp_get_activity_action’, array( $action, &$activities_template->activity ) );

    And that was sort of dead end for me. Could somebody please give me a tip as to where I can edit the aforementioned html? Thanks in advance to all you good folks

Viewing 1 replies (of 1 total)
  • Profile photo of Biswadip


    While I am sorry that @polokina never got an answer I would like to resurrect this thread as I have pretty much got stuck at the same dead end – bp_get_activity_action().

    I am trying, in my child theme, to i) store the activity feed (i.e. avatar, date, content, action, content body, comment/favourite/delete buttons) for a group in an array, in order to then ii) merge the array with another feed from a forum and iii) display the merged feed sorted by date. I think I should be able to do ii) and iii) but I don’t seem to be able to manage i).

    I believe what I should be doing in order to accomplish i) is to filter bp_get_activity_action() but I am not sure what the filter function to hook in should look like. Ideally I would like the function to take the activity feed as input and save that input in an array which I can then manipulate along the lines of ii) and iii).

    So what I would like (in pseudo-code) to insert into my functions.php file is something like:

    ‘add_filter( ‘bp_get_activity_action’, ‘new_activity_array’ );
    function new_activity_array(){
    // i) save the activity feed in an array
    // ii) manipulate the array
    // iii) output the modified array

    As I said I think I can accomplish ii) and iii) so any kind pointers as how to go about accomplishing i) would be gratefully accepted.

    Thank you

Viewing 1 replies (of 1 total)
  • The topic ‘Editing items displayed by bp_activity_action()’ is closed to new replies.
Skip to toolbar