This topic has 15 replies, 2 voices, and was last updated 10 years by Laura.

  • Author
  • #106607
     jazzbuzz
    Participant

    Hi there,

     

    I would like to hide certain info from activity stream.

     

    Used your snippet from the blog but does not work. I keep getting a white page after submitting functions.php.

     

    Where is the issue?

     
    //Block certain activity types from being added
    function bp_activity_dont_save( $activity_object ) {
    $exclude = array(
    ‘updated_profile’,
    ‘new_member’,
    ‘new_avatar’,
    ‘friendship_created’,
    ‘joined_group’
    );

     

    Thank you ๐Ÿ™‚

    #106937
     Laura
    Moderator

    Hello, have you tried https://wordpress.org/plugins/buddypress-block-activity-stream-types/ ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #106961
     jazzbuzz
    Participant

    Hi Laura,

    the plugin hasnยดt been updated in two years so I prefer not to use it ๐Ÿ™

    you published the php snippet already but it does not seem to work. Could you not check it for me please?

    Thank you ๐Ÿ™‚

    #107120
     Laura
    Moderator

    Hello, did you try adding the code to bp-custom.php ( in plugins folder )
    Let me know ๐Ÿ™‚

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #107126
     jazzbuzz
    Participant

    It keeps showing me a white page and I cannot find an error in the code. Could you please check it again?

    Thank you ๐Ÿ™‚

    #107235
     Laura
    Moderator

    Hello, you could try with this, go to the main theme files, copy the file activity-loop.php found buddypress – activity
    and go to the child theme, create 2 new folders, “buddypress” and inside create a new folder “activity” now paste the file and edit it

    Find

    COPY CODE
    
    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
    

    Replace it with

    COPY CODE
    
    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #107259
     jazzbuzz
    Participant

    Hi Laura,

    I do not have such a file. See image attached.

    #107370
     Laura
    Moderator

    Hello, please check inside the main theme files

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #107371
     jazzbuzz
    Participant

    I did and I do not have it ๐Ÿ™

    #107372
     jazzbuzz
    Participant

    Alright my bad… you meant to go to the theme folder not to the plugin folrder.. will try now ๐Ÿ˜‰

    #107374
     jazzbuzz
    Participant

    Did everything like you said. Tried below code in functions.php and bp-custom.php but keep getting a white page even after changing the activity-loop.php ๐Ÿ™

    Where is the issues? ๐Ÿ™

    COPY CODE
    //Block certain activity types from being added
    function bp_activity_dont_save( $activity_object ) {
    $exclude = array(
    'updated_profile',
    'new_member',
    'new_avatar',
    'friendship_created',
    'joined_group'
    );
    
    #107517
     Laura
    Moderator

    What code did you add to activity loop?
    Delete the old code above and only change activity loop as i mentioned before ๐Ÿ™‚
    Let me know

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #107563
     jazzbuzz
    Participant

    I did but what is it doing now, how I can hide certain activities from activity stream?

    #107648
     Laura
    Moderator

    Hello, the code should only show profile updates at the activity

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #107650
     jazzbuzz
    Participant

    Hi Laura,

    it does indeed. Thank you.

    Could you tell me all the events it is showing now?

    #107741
     Laura
    Moderator

    Hello, only profile updates, nothing else ๐Ÿ™‚

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 16 posts - 1 through 16 (of 16 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?