BuddyDev

BuddyPress Activity Shortcode

BuddyPress Activity Shortcode plugin allows you to embed BuddyPress activities in posts/pages using shortcodes.

Here is a sample use example

[activity-stream]

That will list the most recent 5 activities.

Here is a screenshot:-

Here is the way you can specify options

[activity-stream option_name=option_val option_name2=option_val2  and so on]

The accepted parameters:-

  • title(string) :- what should be the title of the activities section
  • pagination(int):- 0 or 1(do you want to hide or show the activity pagination at the bottom of the list)
  • display_comments(sting, int):- possible values are threaded|stream|0(use 0 to hide activity comments)
  • include(int|string):- individual activity id or comma separated list of activities, useful in case you want to list specific activities
  • exclude(int|string):-individual activity id or comma separated list of activities, useful in case you want to exclude specific activities from the list
  • sort(string):- ASC|DESC (how to sort the activities in ascending or descending order)
  • page (int):- which page to load, e.g 1st page or 10th page of activity
  • per_page(int):- How many activities per page(default is 5)
  • max(int):- Limit the maximum no. of activities to be included in the list
  • scope(string):- – pre-built activity filters for a user (possible values are friends/groups/favorites/mentions)
  • user_id(int):- If you want to list a particular user’s activity
  • object(string):- object to filter on e.g. groups, profile, status, friends(what type of activity is this)
  • action(string):- action to filter on e.g. activity_update, new_forum_post, profile_updated(why this activity was created)
  • primary_id(int):- object ID to filter on e.g. a group_id or forum_id or blog_id etc. We will see the use in a minute.
  • secondary_id(int):- secondary object ID to filter on e.g. a post_id(I don’t think you are going to use it)
  • search_terms(String):- In case you want to list the results of activity search
  • allow_posting(int):- If you want to allow users to post. It will include the default activity posting form. It is experimental and may have issues on some of the themes.
  • hide_on_activity(int):- Default 1. Hide/show the shortcode content on activity pages(If you are using it in sidebar and want it to be visible on user/group/site activity page, set it to 0)
  • container_class(string):- Default ‘activity’ . Allows to change the class of the shortcode contents wrapper. If you have the hide_on_activity=0, then please set it to some other value than ‘activity'(May be ‘activities’ or something else). If you do not change it, On the user/group/site activity page, the activity filter will affect the content of the shotrcode. It is suggested to change it if hide_on_activity=0 is set.

We will see some examples in a minute. Before that, I will just like to clarify that you can use the combination of above options to list any type of activity you want.

Examples:-

List all activities of user with user_id=1

[activity-stream user_id=1]

List 10 recent activities per page:-

[activity-stream per_page=10]

List activities containing word “awesome”

[activity-stream search_terms=’awesome’]

List all group activities:-

[activity-stream object=groups]

List all activities of  the group Batman Fan club(Assuming that the group id is 2)

[activity-stream object=groups primary_id=2]

Well guys, It’s up to you to explore the possibilities.

Release History

  • Version: 1.0.8

    Tuesday, 06 June, 2017
    • Tested With: BuddyPress 2.8.2
    • Compatible With: BuddyPress 2.2+

    Updated to allow using on the activity pages too.

  • Version: 1.0.6

    Monday, 30 May, 2016
    • Tested With: BuddyPress 2.5.3
    • Compatible With: BuddyPress 2.2+

    Updated to allow load more for non filtered activity. Please do not use load more with filtered activity

  • Version: 1.0.5

    Wednesday, 14 October, 2015
    • Tested With: BuddyPress 2.4.0
    • Compatible With: BuddyPress 2.0+

    Added readme.txt file

  • Version: 1.0.4

    Saturday, 03 October, 2015
    • Tested With: BuddyPress 2.3.3
    • Compatible With: BuddyPress 2.0+

    Updated to fix pagination issue

  • Version: 1.0.3

    Tuesday, 05 May, 2015
    • Tested With: BuddyPress 2.2.3.1
    • Compatible With: BuddyPress 2.0+

    Added option to allow showing activity post form.
    Also, do not show the activity listing on site activity, user activity and group activity when user is logged in to the site.

  • Version: 1.0.2

    Sunday, 08 February, 2015
    • Tested With: BuddyPress 2.2.0
    • Compatible With: BuddyPress 1.7+

    Updated to include #buddypress div as wrapper in theme compat mode.

  • Version: 1.0.1

    Tuesday, 18 June, 2013
    • Tested With: BuddyPress 1.7.2
    • Compatible With: BuddyPress 1.7+

    Updated to fix the issue with template compatibility. Now will work with any theme.

  • Version: 1.0

    Saturday, 15 June, 2013
    • Tested With: BuddyPress 1.7.2
    • Compatible With: BuddyPress 1.7+

    Initial release