Skip to:
Content
Pages
Categories
Search
Top
Bottom

filter activity stream re friends


  • mrjanvier
    Participant

    @mrjanvier

    Dear,

    I would like to ask advice. Is there an up to date 2019 way to limit activity stream to see onley youre friends news? A plugin ore another way? To see all the streams of all people is a bit overwelming.
    could anyone help me with this?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)

  • shanebp
    Moderator

    @shanebp

    You can use the scope argument for that.
    Try this in your theme > functions.php or in bp-custom.php

    function bp_activities_user_friends_scope( $retval ) {
    
        if ( bp_is_activity_directory() ) {
            $retval['scope'] = 'friends';
        }
     
        return $retval;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'bp_activities_user_friends_scope' );

    mrjanvier
    Participant

    @mrjanvier

    hi,

    I thank you for youre response. I’m new in to this. I searched information about bp-custom.php.
    If i understand well, this is not an map that is already there. I need to make a map with an editor and place it on the server with a program like: filezilla?

    thank you, have a nice day


    shanebp
    Moderator

    @shanebp

    Yes, you need to create bp-custom.php and place it on your server – as explained in the link I provided.


    mrjanvier
    Participant

    @mrjanvier

    Dear,

    I tried but it didn’t work. I made a bp-custom.php map in: wp-content/plugins/bp-custom.php –> In the map bp-custom.php i placed a file bp-custom.php
    I used notedpadd ++ as a editor to place the code you give me and copied it to my server. Once installed, i can’t enter my site. It gives an error:
    Warning: require …
    Fatal error: require(): Failed opening .. class-buddypress.php on line 226

    This looks strange, cause the code filled in notepadd ++ goes only to line 11.

    I filled it in as:
    <?php
    function bp_activities_user_friends_scope( $retval ) {

    if ( bp_is_activity_directory() ) {
    $retval[‘scope’] = ‘friends’;
    }

    return $retval;
    }
    add_filter( ‘bp_after_has_activities_parse_args’, ‘bp_activities_user_friends_scope’ );
    ?>

    did I do something wrong?

    Big thank for youre help


    shanebp
    Moderator

    @shanebp

    I made a bp-custom.php map in: wp-content/plugins/bp-custom.php –> In the map bp-custom.php i placed a file bp-custom.php

    By map you mean a directory ?
    If so – delete the directory called bp-custom.php
    Put your bp-custom.php file in the plugins directory: wp-content/plugins/

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar