What are accepted parameters for activity shortcodes?

Following is the shortcode for activity listing you can use this in your post and pages:

[activity-listing] #

Here is the way you can specify options

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

For Example: [activity-listing title=Chris_Group object=Groups per_page=1].

 

The accepted parameters:-

  • title (string):- What should be the title of the activities section

Example: [activity-listing title=My_Activity-Listing per_page=2].

  • display_comments (sting|bool):- How to handle activity comments.
  • Possible values: – ‘threaded’ – comments appear in a threaded tree, under their parent items.
    – ‘stream’ – the activity stream is presented in a flat manner, with comments sorted in chronological order alongside other activity items.
    – false – don’t fetch activity comments at all.
    Default: ‘threaded’.
  • include (string):- Activity IDs or string of activity IDs comma-separated to query. Providing an ‘include’ activity IDs will override all other filters passed in the argument. When viewing the permalink page for a single activity item, this value defaults to the ID of that item. Otherwise, the default is false.
  • in (string):- Activity IDs or string of activity IDs comma-separated to limit the query by (IN). ‘in’ is intended to be used in conjunction with other filter parameters. Default: false.
  • exclude (string):- Activity IDs or string of activity IDs comma-separated to exclude. Default: false.
  • sort (string):- ‘ASC’ or ‘DESC’. Default: ‘DESC’.

Example: [activity-listing title=Chris_Group object=Groups sort=ASC].

  • per_page (int):- Number of results per page. Default: 20.

Example: [activity-listing per_page=4]

  • page_args (int):- String used as a query parameter in pagination links. Default: ‘page’.
  • max (int):- Limit the maximum no. of activities to be included in the list.

Example: [activity-listing title=Max_Activity-Listing max=1].

  • scope (string):- Use a BuddyPress pre-built filter.
    – ‘just-me’ retrieves items belonging only to a user; this is equivalent to passing a ‘user_id’ argument.
    – ‘friends’ retrieves items belonging to the friends of a user.
    – ‘groups’ retrieves items belonging to groups to which a user belongs to.
    – ‘favorites’ retrieves a user’s favorited activity items.
    – ‘mentions’ retrieves items where a user has received an @-mention.
    The default value of ‘scope’ is set to one of the above if that value appears in the appropriate place in the URL; eg, ‘scope’ will be ‘groups’
    when visiting http://example.com/members/joe/activity/groups/.
    Otherwise defaults to false.
  • 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.

Example: [activity-listing object=groups primary_id=2].

  • 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 the sidebar and want it to be visible on user/group/site activity page, set it to 0)
  • container_class (string):- Default ‘activity’ . Allows changing 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'(Maybe ‘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 shortcodes. It is suggested to change it if hide_on_activity=0 is set.

This shortcode can take the following parameters:

Examples:-

[activity-listing per_page=2] #

This [activity-listing per_page=2] shortcode shows a list of Activity, and it accompanies a great deal of parameters to customize which activity is appeared and how they are spread out.

[activity-listing user_id=1] #

You can use this shortcode to shows the content of the user activity list. The shortcode can be used on any page or widget area.

 

[activity-listing search_terms=’Arts and Science.’] #

This shortcode uses to show list activities containing the search word “Arts and Science.”

 

[activity-listing object=groups] #

This [activity-listing object=groups] shortcode uses to shows the List of all activities of the group.

[activity-listing object=groups primary_id=2] #

 

[activity-listing object=groups primary_id=40 per_page=2] #

With the help of this shortcode, we can display particular group activities per page.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[activity-listing title=Posted] #

With the help of this shortcode , we can display activities by title.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[activity-listing allow_posting=true] #

Use this shortcode to allow posting on shortcode-driven pages.

 

 

 

 

 

 

 

 

 

 

 

 

[activity-listing role=”administrator” scope=favorites] #

With the help of this shortcode, display the list of favorites activities of a particular user role.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[activity-listing activity-stream user_id=3 sort=”DESC”] #

With the help of this shortcode, display the list activity of the particular user in descending order.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[activity-listing activity-stream user_id=3 sort=”ASC”] #

With the help of this shortcode, display the list activity of the particular user in descending order.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[activity-listing scope=mentions] #

With the help of this shortcode, display the list of mention activities .

 

 

 

 

 

 

 

 

 

 

 

logo