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)
  • load_more(int) :- 0 or 1. Use load more button for loading the activities in current context.
  • 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
  • for(string):- User type you want to display for. Possible values 'logged', 'displayed', 'author'.
  • role(string):- One of more WordPress roles. eg. 'administrator' or 'administrator,editor'. It will filter the activity and list for the given roles only.
  • object(string):- object to filter on e.g. groups, profile, status, friends(what type of activity is this)
  • for_group(string):- specify a group slug. Only valid if the object=groups is specified
  • 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 all activities of administrator

[activity-stream role=administrator]

List activities of administrator and editor:-

[activity-stream role="administrator,editor"]

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.1.8

    Tuesday, 29 June, 2021
    • Tested With: BuddyPress 8.0.0
    • Compatible With: BuddyPress 6.0+

    Add support to show private activities of a group if the user is a member of the group.

  • Version: 1.1.7

    Friday, 24 April, 2020
    • Tested With: BuddyPress 5.2.0
    • Compatible With: BuddyPress 4.0

    Fix css class name issue.

  • Version: 1.1.6

    Thursday, 23 April, 2020
    • Tested With: BuddyPress 5.2
    • Compatible With: BuddyPress 4.0

    Added a filter for filtering activity list css class.

  • Version: 1.1.5

    Tuesday, 31 July, 2018
    • Tested With: BuddyPress 3.1
    • Compatible With: BuddyPress 2.5+

    Fix pagination.
    Fix posting to group without content.

  • Version: 1.1.4

    Sunday, 01 July, 2018
    • Tested With: BuddyPress 3.1
    • Compatible With: BuddyPress 2.5+

    Added support for for_group option
    Enhanced posting to group
    Respect role when scope=following

  • Version: 1.1.3

    Saturday, 24 February, 2018
    • Tested With: BuddyPress 2.9.3
    • Compatible With: BuddyPress 2.5+

    Add support for load more. Sponsored by Shay.

  • Version: 1.1.2

    Saturday, 10 February, 2018
    • Tested With: BuddyPress 2.9.3
    • Compatible With: BuddyPress 2.5+

    Added support for scope='following' with context for='displayed', for='logged' or for='author'

  • Version: 1.1.1

    Monday, 06 November, 2017
    • Tested With: BuddyPress 2.9.2
    • Compatible With: BuddyPress 2.5+

    Added actions to allow adding extra content to the shortcode.

  • Version: 1.1.0

    Friday, 03 November, 2017
    • Tested With: BuddyPress 2.9.2
    • Compatible With: BuddyPress 2.5+

    Add support for filtering by roles.

  • Version: 1.0.9

    Tuesday, 03 October, 2017
    • Tested With: BuddyPress 2.9.1
    • Compatible With: BuddyPress 2.5+

    Added support for displaying activity for Logged In, Displayed user and post authors.

  • 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