Skip to:

"Friends Only" custom filter – codex incomplete?

  • mrgiblets


    I want to add a custom filter that displays only activity updates from friends.

    So I’m reading this…

    Add custom filters to loops and enjoy them within your plugin

    Firstly…. Seriously? You have to create an entire plug-in just to add a simple filter?

    Secondly…. I’ve read this tutorial about 4 times now and I can see how the list item is being added in both the front & backends, but I can’t for the life of me see the actual function that is returning the random order? Where is the database being queried for this new function? All I can see is a new list item being created in the dropdown menu. This doesn’t show me how to add any new functionality whatsoever.

    Similarly I was browsing the following in the codex :

    Activity Loop

    Posted in 2009? 6 years old and this is the official doc for the Activity Stream Loop?
    Also, plenty of “things” that you can do on this page, but no examples of how to implement them apart from one that apparently “Filters the activity loop to show only activity updates in the activity stream”…

    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>

    … Which is something that buddypress is already doing by default if i’m not mistaken?

    I am constantly finding that it’s other websites and blogs that are actually explaining how buddypress works because I can’t find straight answers in the BP codex. It’s like it’s been written solely for the buddypress dev team and not meant to be understood by anybody else.

    Come on guys, please throw us a few crumbs here, this is so frustrating.

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

  • Hugo Ashmore


    Come on guys, please throw us a few crumbs here, this is so frustrating.

    First crumb, this is an open source volunteer driven app, all aspects such as the codex get worked on with what ever free time is available.
    Second crumb, Being community driven means that the project moves at a pace that is dictated by that community and all have the ability to create, edit the codex and help the documentation grow.

    Probably a little before your time but last year a lot of time and effort was put into the codex, this, though, is an ongoing process and we do not say it’s by any means finished or hasn’t heaps of room for improvement and we welcome all contributions to improve it.



    The codex is maintained and written by volonteers since BP exist. (2007)
    Codex explains principaly how BP works. It is not the place to get some ready to use tips or code for special cases.

    For such things you have the forum where you can search or ask for.

    If you have ideas or enhancement request, you can open a ticket for this on Trac.

    The standard (members)activity loop action is not random, but current_action (depending if you’re on the SWA, your profile or in a group activity) and chronological to any activity, in order they came up (again in the limit of previous mentionned tabs).

    Yes BP has “6 years old code” in it which is already working ! 😉 What would you say if BP code changed every week !

    Now to your question. You have several option to do that, which needs you to be confirmed.

    Only the activity directory should show Friends activities by default ?
    All activity walls should show friends activities by default ?

    In the first case, only logged in user will then see something, and only if they have friends. Else they’ll see nothing !

    In the second case, you’ll get the same behave on All mentionned places.

    If a friends activity filter is not implemented there, it’s because it’s more logical that users can get this information from within a profile. It’s not very pertinent on the main activity page.

    But you can anyway code it, as explained in your first link.
    Or much simplier, by using this way:

    Using bp_parse_args() to filter BuddyPress template loops



    Hey guys,

    Thanks for your replies.

    Firstly, I am going to eat some humble pie. I didn’t realise that buddypress was entirely user driven and supported so apologies for jumping the gun there.

    I promise that I will make it my mission to share anything I learn while using buddypress and offer help to others in the spirit of the project. It could certainly do with some basic “start up” guides, there are a few simple things that virtually everybody using this for the first time is going to want to do and they could be laid out in simple terms with easy to follow “how to” guides and I am more than happy to post a few of these once I am confident that I know what I’m doing is correct.

    Thanks for the explanation and link Dan, that is most helpful.

    I’m slowly starting to understand how everything ties together, and I’m sure I’ll have a million other questions along the way, but I’m also pretty confident that I’ll crack it and once I do I will be more than happy to contribute to the BP family wherever possible 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘"Friends Only" custom filter – codex incomplete?’ is closed to new replies.
Skip to toolbar