Changeset 9255 for trunk/src/bp-activity/bp-activity-template.php
- Timestamp:
- 12/22/2014 08:43:35 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r9194 r9255 434 434 * 435 435 * @param array $args { 436 * Arguments for limiting the contents of the activity loop. Most 437 * arguments are in the same format as {@link BP_Activity_Activity::get()}. 438 * However, because the format of the arguments accepted here differs in 439 * a number of ways, and because bp_has_activities() determines some 440 * default arguments in a dynamic fashion, we list all accepted arguments 441 * here as well. 442 * 443 * Arguments can be passed as an associative array, or as a URL query 444 * string (eg, 'user_id=4&display_comments=threaded'). 445 * 446 * @type int $page Which page of results to fetch. Using page=1 without 447 * per_page will result in no pagination. Default: 1. 448 * @type int|bool $per_page Number of results per page. Default: 20. 449 * @type string $page_arg The string used as a query parameter in 450 * pagination links. Default: 'acpage'. 451 * @type int|bool $max Maximum number of results to return. 452 * Default: false (unlimited). 453 * @type string|bool $count_total If true, an additional DB query is run to 454 * count the total activity items for the query. Default: false. 455 * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'. 456 * @type array|bool $exclude Array of activity IDs to exclude. Default: false. 457 * @type array|bool $in Array of IDs to limit query by (IN). 'in' is 458 * intended to be used in conjunction with other filter parameters. 459 * Default: false. 460 * @type array|bool $include Array of exact activity IDs to query. 461 * Providing an 'include' array will override all other filters 462 * passed in the argument array. When viewing a the permalink page 463 * for a single activity item, this value defaults to the ID of that 464 * item. Otherwise the default is false. 465 * @type array $meta_query Limit by activitymeta by passing an array of 466 * meta_query conditions. See {@link WP_Meta_Query::queries} for a 467 * description of the syntax. 468 * @type string $search_terms Limit results by a search term. Default: false. 469 * @type string|bool $scope Use one of BuddyPress's pre-built filters. In 470 * each case, the term 'current user' refers to the displayed user 471 * when looking at a user profile, and otherwise to the logged-in user. 472 * - 'just-me' retrieves items belonging only to the logged-in user; 473 * this is equivalent to passing a 'user_id' argument 474 * - 'friends' retrieves items belonging to the friends of the 475 * current user 476 * - 'groups' retrieves items associated with the groups to which 477 * the current user belongs 478 * - 'favorites' retrieves the current user's favorited activity 479 * items 480 * - 'mentions' retrieves activity items where the current user has 481 * received an @-mention 482 * The default value of 'scope' is set to one of the above if that 483 * value appears in the appropriate place in the URL; eg, 'scope' will 484 * be 'groups' when visiting http://example.com/members/joe/activity/groups/. 485 * Otherwise defaults to false. 486 * @type int|array|bool $user_id The ID(s) of user(s) whose activity should 487 * be fetched. Pass a single ID or an array of IDs. When viewing a 488 * user profile page (but not that user's activity subpages, ie My 489 * Friends, My Groups, etc), 'user_id' defaults to the ID of the 490 * displayed user. Otherwise the default is false. 491 * @type string|array|bool $object Filters by the `component` column in the 492 * database, which is generally the component ID in the case of 493 * BuddyPress components, or the plugin slug in the case of plugins. 494 * For example, 'groups' will limit results to those that are 495 * associated with the BP Groups component. Accepts a single 496 * component string, or an array of multiple components. Defaults to 497 * 'groups' when viewing the page of a single group, the My Groups 498 * activity filter, or the Activity > Groups filter of a user profile. 499 * Otherwise defaults to false. 500 * @type string|array|bool $action Filters by the `type` column in the 501 * database, which is a string categorizing the activity item (eg, 502 * 'new_blog_post', 'created_group'). Accepts a single type string, 503 * or an array of multiple types. Defaults to false. 504 * @type int|array|bool $primary_id Filters by the `item_id` column in the 505 * database. The meaning of 'primary_id' differs between components/ 506 * types; for example, in the case of 'created_group', 'primary_id' 507 * is the ID of the group. Accepts a single ID, or an array of 508 * multiple IDs. When viewing a single group, defaults to the current 509 * group ID. When viewing a user's Groups stream page, defaults to 510 * the IDs of the user's groups. Otherwise defaults to false. 511 * @type int|array|bool $secondary_id Filters by the `secondary_item_id` 512 * column in the database. The meaning of 'secondary_id' differs 513 * between components/types. Accepts a single ID, or an array of 514 * multiple IDs. Defaults to false. 515 * @type int $offset Return only activity items with an ID greater than or 516 * equal to this one. Note that providing an offset will disable 517 * pagination. Default: false. 518 * @type string|bool $display_comments How to handle activity comments. 519 * Possible values: 520 * - 'threaded' - comments appear in a threaded tree, under their 521 * parent items 522 * - 'stream' - the activity stream is presented in a flat manner, 523 * with comments sorted in chronological order alongside other 524 * activity items 525 * - false - don't fetch activity comments at all 526 * Default: 'threaded'. 527 * @type bool $show_hidden Whether to show items marked hide_sitewide. 528 * Defaults to false, except in the following cases: 529 * - User is viewing his own activity stream 530 * - User is viewing the activity stream of a non-public group of 531 * which he is a member 532 * @type bool $show_hidden Normally defaults to false, except when: 533 * - a user is viewing his own activity stream 534 * - a user is viewing the activity stream of a non-public group of 535 * which he is a member 536 * @type string|bool $spam Spam status. 'ham_only', 'spam_only', or false 537 * to show all activity regardless of spam status. Default: 'ham_only'. 538 * @type bool $populate_extras Whether to pre-fetch the activity metadata 539 * for the queried items. Default: true. 436 * Arguments for limiting the contents of the activity loop. Most arguments 437 * are in the same format as {@link BP_Activity_Activity::get()}. However, 438 * because the format of the arguments accepted here differs in a number of 439 * ways, and because bp_has_activities() determines some default arguments in 440 * a dynamic fashion, we list all accepted arguments here as well. 441 * 442 * Arguments can be passed as an associative array, or as a URL querystring 443 * (eg, 'user_id=4&display_comments=threaded'). 444 * 445 * @type int $page Which page of results to fetch. Using page=1 without per_page will result 446 * in no pagination. Default: 1. 447 * @type int|bool $per_page Number of results per page. Default: 20. 448 * @type string $page_arg String used as a query parameter in pagination links. Default: 'acpage'. 449 * @type int|bool $max Maximum number of results to return. Default: false (unlimited). 450 * @type string|bool $count_total If true, an additional DB query is run to count the total activity items 451 * for the query. Default: false. 452 * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'. 453 * @type array|bool $exclude Array of activity IDs to exclude. Default: false. 454 * @type array|bool $in Array of IDs to limit query by (IN). 'in' is intended to be used in 455 * conjunction with other filter parameters. Default: false. 456 * @type array|bool $include Array of exact activity IDs to query. Providing an 'include' array will 457 * override all other filters passed in the argument array. When viewing the 458 * permalink page for a single activity item, this value defaults to the ID of 459 * that item. Otherwise the default is false. 460 * @type array $meta_query Limit by activitymeta by passing an array of meta_query conditions. See 461 * {@link WP_Meta_Query::queries} for a description of the syntax. 462 * @type array $date_query Limit by date by passing an array of date_query conditions. See first 463 * parameter of {@link WP_Date_Query::__construct()} for syntax. 464 * @type string $search_terms Limit results by a search term. Default: false. 465 * @type string $scope Use a BuddyPress pre-built filter. 466 * - 'just-me' retrieves items belonging only to a user; this is equivalent 467 * to passing a 'user_id' argument 468 * - 'friends' retrieves items belonging to the friends of a user 469 * - 'groups' retrieves items belonging to groups to which a user belongs to 470 * - 'favorites' retrieves a user's favorited activity items 471 * - 'mentions' retrieves items where a user has received an @-mention 472 * The default value of 'scope' is set to one of the above if that value 473 * appears in the appropriate place in the URL; eg, 'scope' will be 'groups' 474 * when visiting http://example.com/members/joe/activity/groups/. Otherwise 475 * defaults to false. 476 * @type int|array|bool $user_id The ID(s) of user(s) whose activity should be fetched. Pass a single ID or 477 * an array of IDs. When viewing a user profile page (but not that user's 478 * activity subpages, ie My Friends, My Groups, etc), 'user_id' defaults to 479 * the ID of the displayed user. Otherwise the default is false. 480 * @type string|array|bool $object Filters by the `component` column in the database, which is generally the 481 * component ID in the case of BuddyPress components, or the plugin slug in 482 * the case of plugins. For example, 'groups' will limit results to those that 483 * are associated with the BP Groups component. Accepts a single component 484 * string, or an array of multiple components. Defaults to 'groups' when 485 * viewing the page of a single group, the My Groups activity filter, or the 486 * Activity > Groups filter of a user profile. Otherwise defaults to false. 487 * @type string|array|bool $action Filters by the `type` column in the database, which is a string 488 * categorizing the activity item (eg, 'new_blog_post', 'created_group'). 489 * Accepts a comma-delimited string or an array of types. Default: false. 490 * @type int|array|bool $primary_id Filters by the `item_id` column in the database. The meaning of 491 * 'primary_id' differs between components/types; for example, in the case of 492 * 'created_group', 'primary_id' is the ID of the group. Accepts a single ID, 493 * or an array of multiple IDs. When viewing a single group, defaults to the 494 * current group ID. When viewing a user's Groups stream page, defaults to the 495 * IDs of the user's groups. Otherwise defaults to false. 496 * @type int|array|bool $secondary_id Filters by the `secondary_item_id` column in the database. The meaning of 497 * 'secondary_id' differs between components/types. Accepts a single ID, or an 498 * array of multiple IDs. Defaults to false. 499 * @type int $offset Return only activity items with an ID greater than or equal to this one. 500 * Note that providing an offset will disable pagination. Default: false. 501 * @type string|bool $display_comments How to handle activity comments. Possible values: 502 * - 'threaded' - comments appear in a threaded tree, under their parent 503 * items 504 * - 'stream' - the activity stream is presented in a flat manner, with 505 * comments sorted in chronological order alongside other activity items 506 * - false - don't fetch activity comments at all 507 * Default: 'threaded'. 508 * @type bool $show_hidden Whether to show items marked hide_sitewide. Defaults to false, except in 509 * the following cases: 510 * - User is viewing his own activity stream 511 * - User is viewing the activity stream of a non-public group of which he 512 * is a member 513 * @type string|bool $spam Spam status. 'ham_only', 'spam_only', or false to show all activity 514 * regardless of spam status. Default: 'ham_only'. 515 * @type bool $populate_extras Whether to pre-fetch the activity metadata for the queried items. 516 * Default: true. 540 517 * } 541 518 * @return bool Returns true when activities are found, otherwise false.
Note: See TracChangeset
for help on using the changeset viewer.