Changeset 9833 for trunk/src/bp-activity/bp-activity-functions.php
- Timestamp:
- 05/03/2015 06:51:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r9819 r9833 61 61 * mentions suggestions? 62 62 * 63 * @since BuddyPress (2.1.0) 64 * 63 65 * @return bool True if mentions scripts should be loaded. 64 * @since BuddyPress (2.1.0)65 66 */ 66 67 function bp_activity_maybe_load_mentions_scripts() { … … 73 74 * @since BuddyPress (2.1.0) 74 75 * 75 * @param bool $load_mentions True to load mentions assets, false otherwise.76 * @param bool $load_mentions True to load mentions assets, false otherwise. 76 77 * @param bool $mentions_enabled True if mentions are enabled. 77 78 */ … … 85 86 * 86 87 * @param string $content The content of the activity, usually found in 87 * $activity->content. 88 * $activity->content. 89 * 88 90 * @return array|bool Associative array with user ID as key and username as 89 * value. Boolean false if no mentions found.91 * value. Boolean false if no mentions found. 90 92 */ 91 93 function bp_activity_find_mentions( $content ) { … … 148 150 * @uses bp_activity_update_mention_count_for_user() 149 151 * 150 * @param int $activity_id The unique id for the activity item. 151 * @param string $action Can be 'delete' or 'add'. Defaults to 'add'. 152 * @param int $activity_id The unique id for the activity item. 153 * @param string $action Can be 'delete' or 'add'. Defaults to 'add'. 154 * 155 * @return bool 152 156 */ 153 157 function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) { … … 186 190 * @uses bp_update_user_meta() 187 191 * 188 * @param int $user_id The user ID. 189 * @param int $activity_id The unique ID for the activity item. 190 * @param string $action 'delete' or 'add'. Default: 'add'. 192 * @param int $user_id The user ID. 193 * @param int $activity_id The unique ID for the activity item. 194 * @param string $action 'delete' or 'add'. Default: 'add'. 195 * 191 196 * @return bool 192 197 */ … … 239 244 * 240 245 * @since BuddyPress (1.9.0) 246 * 247 * @param int|string $user_id ID of the user to get @-mention name for. 241 248 * 242 249 * @return string User name appropriate for @-mentions. … … 316 323 * @since BuddyPress (1.1.0) 317 324 * 318 * @param string $component_id The unique string ID of the component. 319 * @param string $type The action type. 320 * @param string $description The action description. 321 * @param callable $format_callback Callback for formatting the action string. 322 * @param string $label String to describe this action in the activity stream filter dropdown. 323 * @param array $context Optional. Activity stream contexts where the filter should appear. 324 * Values: 'activity', 'member', 'member_groups', 'group' 325 * @param int $position Optional. The position of the action when listed in dropdowns. 325 * @param string $component_id The unique string ID of the component. 326 * @param string $type The action type. 327 * @param string $description The action description. 328 * @param callable|bool $format_callback Callback for formatting the action string. 329 * @param string|bool $label String to describe this action in the activity stream filter dropdown. 330 * @param array $context Optional. Activity stream contexts where the filter should appear. 331 * Values: 'activity', 'member', 'member_groups', 'group' 332 * @param int $position Optional. The position of the action when listed in dropdowns. 333 * 326 334 * @return bool False if any param is empty, otherwise true. 327 335 */ … … 353 361 * @since BuddyPress (1.1.0) 354 362 * 355 * @param array $array Array of arguments for action type being set.356 * @param string $component_id ID of the current component being set.357 * @param string $type Action type being set.358 * @param string $description Action description for action being set.363 * @param array $array Array of arguments for action type being set. 364 * @param string $component_id ID of the current component being set. 365 * @param string $type Action type being set. 366 * @param string $description Action description for action being set. 359 367 * @param callable $format_callback Callback for formatting the action string. 360 * @param string $label String to describe this action in the activity stream filter dropdown.361 * @param array $context Activity stream contexts where the filter should appear. 'activity', 'member',362 * 'member_groups', 'group'.368 * @param string $label String to describe this action in the activity stream filter dropdown. 369 * @param array $context Activity stream contexts where the filter should appear. 'activity', 'member', 370 * 'member_groups', 'group'. 363 371 */ 364 372 $bp->activity->actions->{$component_id}->{$type} = apply_filters( 'bp_activity_set_action', array( … … 406 414 * the post type does not natively support comments, otherwise false. 407 415 * } 416 * 417 * @return bool 408 418 */ 409 419 function bp_activity_set_post_type_tracking_args( $post_type = '', $args = array() ) { … … 433 443 * @since BuddyPress (2.2.0) 434 444 * 435 * @param string $post_type Name of the post type 445 * @param string $post_type Name of the post type. 446 * 436 447 * @return object The tracking arguments of the post type. 437 448 */ … … 490 501 * 491 502 * @param object $post_type_activity The tracking arguments of the post type. 492 * @param string $post_type Name of the post type.503 * @param string $post_type Name of the post type. 493 504 */ 494 505 return apply_filters( 'bp_activity_get_post_type_tracking_args', $post_type_activity, $post_type ); … … 582 593 * 583 594 * @param string $component_id The unique string ID of the component. 584 * @param string $key The action key. 595 * @param string $key The action key. 596 * 585 597 * @return string|bool Action value if found, otherwise false. 586 598 */ … … 654 666 * 655 667 * @param int $user_id ID of the user whose favorites are being queried. 668 * 656 669 * @return array IDs of the user's favorite activity items. 657 670 */ … … 690 703 * 691 704 * @param int $activity_id ID of the activity item being favorited. 692 * @param int $user_id ID of the user favoriting the activity item. 705 * @param int $user_id ID of the user favoriting the activity item. 706 * 693 707 * @return bool True on success, false on failure. 694 708 */ … … 734 748 * 735 749 * @param int $activity_id ID of the activity item being favorited. 736 * @param int $user_id ID of the user doing the favoriting.750 * @param int $user_id ID of the user doing the favoriting. 737 751 */ 738 752 do_action( 'bp_activity_add_user_favorite', $activity_id, $user_id ); … … 750 764 * 751 765 * @param int $activity_id ID of the activity item being favorited. 752 * @param int $user_id ID of the user doing the favoriting.766 * @param int $user_id ID of the user doing the favoriting. 753 767 */ 754 768 do_action( 'bp_activity_add_user_favorite_fail', $activity_id, $user_id ); … … 771 785 * 772 786 * @param int $activity_id ID of the activity item being unfavorited. 773 * @param int $user_id ID of the user unfavoriting the activity item. 787 * @param int $user_id ID of the user unfavoriting the activity item. 788 * 774 789 * @return bool True on success, false on failure. 775 790 */ … … 814 829 * 815 830 * @param int $activity_id ID of the activity item being unfavorited. 816 * @param int $user_id ID of the user doing the unfavoriting.831 * @param int $user_id ID of the user doing the unfavoriting. 817 832 */ 818 833 do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id ); … … 846 861 * 847 862 * @param string $content The content to filter by. 863 * 848 864 * @return int|null The ID of the located activity item. Null if none is found. 849 865 */ … … 890 906 * 891 907 * @param int $user_id ID of the user whose favorite count is being requested. 908 * 892 909 * @return int Total favorite count for the user. 893 910 */ … … 911 928 * @global object $wpdb WordPress database access object. 912 929 * 913 * @param int $activity_id ID of the activity item whose metadata is being deleted. 914 * @param string $meta_key Optional. The key of the metadata being deleted. If 915 * omitted, all metadata associated with the activity 916 * item will be deleted. 917 * @param string $meta_value Optional. If present, the metadata will only be 918 * deleted if the meta_value matches this parameter. 919 * @param bool $delete_all Optional. If true, delete matching metadata entries 920 * for all objects, ignoring the specified object_id. Otherwise, 921 * only delete matching metadata entries for the specified 922 * activity item. Default: false. 930 * @param int $activity_id ID of the activity item whose metadata is being deleted. 931 * @param string $meta_key Optional. The key of the metadata being deleted. If 932 * omitted, all metadata associated with the activity 933 * item will be deleted. 934 * @param string $meta_value Optional. If present, the metadata will only be 935 * deleted if the meta_value matches this parameter. 936 * @param bool $delete_all Optional. If true, delete matching metadata entries 937 * for all objects, ignoring the specified object_id. Otherwise, 938 * only delete matching metadata entries for the specified 939 * activity item. Default: false. 940 * 923 941 * @return bool True on success, false on failure. 924 942 */ … … 954 972 * @uses apply_filters() To call the 'bp_activity_get_meta' hook. 955 973 * 956 * @param int $activity_id ID of the activity item whose metadata is being requested. 957 * @param string $meta_key Optional. If present, only the metadata matching 958 * that meta key will be returned. Otherwise, all metadata for the 959 * activity item will be fetched. 960 * @param bool $single Optional. If true, return only the first value of the 961 * specified meta_key. This parameter has no effect if meta_key is not 962 * specified. Default: true. 974 * @param int $activity_id ID of the activity item whose metadata is being requested. 975 * @param string $meta_key Optional. If present, only the metadata matching 976 * that meta key will be returned. Otherwise, all metadata for the 977 * activity item will be fetched. 978 * @param bool $single Optional. If true, return only the first value of the 979 * specified meta_key. This parameter has no effect if meta_key is not 980 * specified. Default: true. 981 * 963 982 * @return mixed The meta value(s) being requested. 964 983 */ … … 973 992 * @since BuddyPress (1.5.0) 974 993 * 975 * @param mixed $retval The meta values for the activity item.994 * @param mixed $retval The meta values for the activity item. 976 995 * @param int $activity_id ID of the activity item. 977 * @param string $meta_key Meta key for the value being requested.978 * @param bool $single Whether to return one matched meta key row or all.996 * @param string $meta_key Meta key for the value being requested. 997 * @param bool $single Whether to return one matched meta key row or all. 979 998 */ 980 999 return apply_filters( 'bp_activity_get_meta', $retval, $activity_id, $meta_key, $single ); … … 986 1005 * @since BuddyPress (1.2.0) 987 1006 * 988 * @param int $activity_id ID of the activity item whose metadata is being 989 * updated. 990 * @param string $meta_key Key of the metadata being updated. 991 * @param mixed $meta_value Value to be set. 992 * @param mixed $prev_value Optional. If specified, only update existing 993 * metadata entries with the specified value. Otherwise, update all 994 * entries. 1007 * @param int $activity_id ID of the activity item whose metadata is being updated. 1008 * @param string $meta_key Key of the metadata being updated. 1009 * @param mixed $meta_value Value to be set. 1010 * @param mixed $prev_value Optional. If specified, only update existing metadata entries 1011 * with the specified value. Otherwise, update all entries. 1012 * 995 1013 * @return bool|int Returns false on failure. On successful update of existing 996 * metadata, returns true. On successful creation of new metadata,997 * returns the integer ID of the new metadata row.1014 * metadata, returns true. On successful creation of new metadata, 1015 * returns the integer ID of the new metadata row. 998 1016 */ 999 1017 function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_value = '' ) { … … 1010 1028 * @since BuddyPress (2.0.0) 1011 1029 * 1012 * @param int $activity_id ID of the activity item. 1013 * @param string $meta_key Metadata key. 1014 * @param mixed $meta_value Metadata value. 1015 * @param bool $unique Optional. Whether to enforce a single metadata value 1016 * for the given key. If true, and the object already has a value for 1017 * the key, no change will be made. Default: false. 1030 * @param int $activity_id ID of the activity item. 1031 * @param string $meta_key Metadata key. 1032 * @param mixed $meta_value Metadata value. 1033 * @param bool $unique Optional. Whether to enforce a single metadata value for the 1034 * given key. If true, and the object already has a value for 1035 * the key, no change will be made. Default: false. 1036 * 1018 1037 * @return int|bool The meta ID on successful update, false on failure. 1019 1038 */ … … 1040 1059 * 1041 1060 * @param int $user_id ID of the user whose activity is being deleted. 1061 * 1062 * @return bool 1042 1063 */ 1043 1064 function bp_activity_remove_all_user_data( $user_id = 0 ) { … … 1078 1099 * 1079 1100 * @param int $user_id ID of the user whose activity is being spammed. 1101 * 1102 * @return bool 1080 1103 */ 1081 1104 function bp_activity_spam_all_user_data( $user_id = 0 ) { … … 1131 1154 * @since BuddyPress (1.6.0) 1132 1155 * 1133 * @param int $user_id ID of the user whose activity is being marked as spam.1156 * @param int $user_id ID of the user whose activity is being marked as spam. 1134 1157 * @param array $activities Array of activity items being marked as spam. 1135 1158 */ … … 1146 1169 * 1147 1170 * @param int $user_id ID of the user whose activity is being hammed. 1171 * 1172 * @return bool 1148 1173 */ 1149 1174 function bp_activity_ham_all_user_data( $user_id = 0 ) { … … 1200 1225 * @since BuddyPress (1.6.0) 1201 1226 * 1202 * @param int $user_id ID of the user whose activity is being marked as ham.1227 * @param int $user_id ID of the user whose activity is being marked as ham. 1203 1228 * @param array $activities Array of activity items being marked as ham. 1204 1229 */ … … 1250 1275 * 1251 1276 * @param object $activity Activity data object. 1277 * 1252 1278 * @return string|bool Returns false if no callback is found, otherwise returns 1253 * the formatted action string.1279 * the formatted action string. 1254 1280 */ 1255 1281 function bp_activity_generate_action_string( $activity ) { … … 1274 1300 * @since BuddyPress (2.0.0) 1275 1301 * 1276 * @param BP_Activity_Activity $action Action string being requested.1302 * @param BP_Activity_Activity $action Action string being requested. 1277 1303 * @param BP_Activity_Activity $activity Activity item object. 1278 1304 */ … … 1290 1316 * @since BuddyPress (2.0.0) 1291 1317 * 1292 * @param string $action Static activity action.1318 * @param string $action Static activity action. 1293 1319 * @param object $activity Activity data object. 1320 * 1294 1321 * @return string 1295 1322 */ … … 1302 1329 * @since BuddyPress (1.2.0) 1303 1330 * 1304 * @param string $action Activity action string value.1331 * @param string $action Activity action string value. 1305 1332 * @param BP_Activity_Activity $activity Activity item object. 1306 1333 */ … … 1313 1340 * @since BuddyPress (2.0.0) 1314 1341 * 1315 * @param string $action Static activity action.1342 * @param string $action Static activity action. 1316 1343 * @param object $activity Activity data object. 1344 * 1317 1345 * @return string 1318 1346 */ … … 1325 1353 * @since BuddyPress (1.2.0) 1326 1354 * 1327 * @param string $action Activity action string value.1355 * @param string $action Activity action string value. 1328 1356 * @param BP_Activity_Activity $activity Activity item object. 1329 1357 */ … … 1338 1366 * @param string $action Static activity action. 1339 1367 * @param object $activity Activity data object. 1368 * 1340 1369 * @return string 1341 1370 */ … … 1382 1411 * @since BuddyPress (2.2.0) 1383 1412 * 1384 * @param string $action Activity action string value.1413 * @param string $action Activity action string value. 1385 1414 * @param BP_Activity_Activity $activity Activity item object. 1386 1415 */ … … 1414 1443 * @uses apply_filters_ref_array() To call the 'bp_activity_get' hook. 1415 1444 * 1416 * @param array $args See BP_Activity_Activity::get() for description. 1445 * @param array|string $args See BP_Activity_Activity::get() for description. 1446 * 1417 1447 * @return array $activity See BP_Activity_Activity::get() for description. 1418 1448 */ … … 1505 1535 * 1506 1536 * @param BP_Activity_Activity $activity Requested activity object. 1507 * @param array $r Arguments used for the activity query.1537 * @param array $r Arguments used for the activity query. 1508 1538 */ 1509 1539 return apply_filters_ref_array( 'bp_activity_get', array( &$activity, &$r ) ); … … 1520 1550 * @uses BP_Activity_Activity::get() {@link BP_Activity_Activity} 1521 1551 * 1522 * @param array $args {1552 * @param array|string $args { 1523 1553 * All arguments and defaults are shared with BP_Activity_Activity::get(), 1524 1554 * except for the following: … … 1560 1590 * 1561 1591 * @param BP_Activity_Activity $activity Requested activity object. 1562 * @param array $args Original passed in arguments.1592 * @param array $args Original passed in arguments. 1563 1593 * @param array $get_args Constructed arguments used with request. 1564 1594 */ … … 1577 1607 * @uses do_action() To call the 'bp_activity_add' hook 1578 1608 * 1579 * @param array $args {1609 * @param array|string $args { 1580 1610 * An array of arguments. 1581 * @type int|bool $id Pass an activity ID to update an existing item, or1582 * false to create a new item. Default: false.1583 * @type string $actionOptional. The activity action/description, typically1584 * something like "Joe posted an update". Values passed to this param1585 * will be stored in the database and used as a fallback for when the1586 * activity item's format_callback cannot be found (eg, when the1587 * component is disabled). As long as you have registered a1588 * format_callback for your $type, it is unnecessary to include this1589 * argument - BP will generate it automatically.1590 * See {@link bp_activity_set_action()}.1591 * @type string $contentOptional. The content of the activity item.1592 * @type string $componentThe unique name of the component associated with1593 * the activity item - 'groups', 'profile', etc.1594 * @type string $typeThe specific activity type, used for directory1595 * filtering. 'new_blog_post', 'activity_update', etc.1596 * @type string $primary_linkOptional. The URL for this item, as used in1597 * RSS feeds. Defaults to the URL for this activity item's permalink page.1598 * @type int|bool $user_id Optional. The ID of the user associated with the1599 * activity item. May be set to false or 0 if the item is not related1600 * to any user. Default: the ID of the currently logged-in user.1601 * @type int $item_id Optional. The ID of the associated item.1602 * @type int $secondary_item_id Optional. The ID of a secondary associated1603 * 1604 * @type string $date_recorded Optional. The GMT time, in Y-m-d h:i:s format,1605 * whenthe item was recorded. Defaults to the current time.1606 * @type bool $hide_sitewideShould the item be hidden on sitewide streams?1607 * Default: false.1608 * @type bool $is_spamShould the item be marked as spam? Default: false.1611 * @type int|bool $id Pass an activity ID to update an existing item, or 1612 * false to create a new item. Default: false. 1613 * @type string $action Optional. The activity action/description, typically 1614 * something like "Joe posted an update". Values passed to this param 1615 * will be stored in the database and used as a fallback for when the 1616 * activity item's format_callback cannot be found (eg, when the 1617 * component is disabled). As long as you have registered a 1618 * format_callback for your $type, it is unnecessary to include this 1619 * argument - BP will generate it automatically. 1620 * See {@link bp_activity_set_action()}. 1621 * @type string $content Optional. The content of the activity item. 1622 * @type string $component The unique name of the component associated with 1623 * the activity item - 'groups', 'profile', etc. 1624 * @type string $type The specific activity type, used for directory 1625 * filtering. 'new_blog_post', 'activity_update', etc. 1626 * @type string $primary_link Optional. The URL for this item, as used in 1627 * RSS feeds. Defaults to the URL for this activity 1628 * item's permalink page. 1629 * @type int|bool $user_id Optional. The ID of the user associated with the activity 1630 * item. May be set to false or 0 if the item is not related 1631 * to any user. Default: the ID of the currently logged-in user. 1632 * @type int $item_id Optional. The ID of the associated item. 1633 * @type int $secondary_item_id Optional. The ID of a secondary associated item. 1634 * @type string $date_recorded Optional. The GMT time, in Y-m-d h:i:s format, when 1635 * the item was recorded. Defaults to the current time. 1636 * @type bool $hide_sitewide Should the item be hidden on sitewide streams? 1637 * Default: false. 1638 * @type bool $is_spam Should the item be marked as spam? Default: false. 1609 1639 * } 1610 1640 * @return int|bool The ID of the activity on success. False on error. … … 1694 1724 * @uses do_action() To call the 'bp_activity_posted_update' hook. 1695 1725 * 1696 * @param array $args {1726 * @param array|string $args { 1697 1727 * @type string $content The content of the activity update. 1698 * @type int $user_id Optional. Defaults to the logged-in user.1728 * @type int $user_id Optional. Defaults to the logged-in user. 1699 1729 * } 1700 1730 * @return int $activity_id The activity id … … 1751 1781 * @since BuddyPress (1.6.0) 1752 1782 * 1753 * @param string $r Content of the activity update.1783 * @param string $r Content of the activity update. 1754 1784 * @param string $activity_content Content of the activity update. 1755 1785 */ … … 1767 1797 * @since BuddyPress (1.2.0) 1768 1798 * 1769 * @param string $content Content of the activity post update.1770 * @param int $user_id ID of the user posting the activity update.1799 * @param string $content Content of the activity post update. 1800 * @param int $user_id ID of the user posting the activity update. 1771 1801 * @param int $activity_id ID of the activity item being updated. 1772 1802 */ … … 1784 1814 * @param WP_Post $post Post object. 1785 1815 * @param int $user_id ID of the post author. 1816 * 1786 1817 * @return int|bool The ID of the activity on success. False on error. 1787 1818 */ … … 1919 1950 * 1920 1951 * @param WP_Post $post Post item. 1952 * 1921 1953 * @return bool True on success, false on failure. 1922 1954 */ … … 1973 2005 * @since BuddyPress (2.2.0) 1974 2006 * 1975 * @param WP_Post $post Post object.2007 * @param WP_Post $post Post object. 1976 2008 * @param BP_Activity_Activity $activity Activity object. 1977 2009 */ … … 1988 2020 * @param int $post_id ID of the post being unpublished. 1989 2021 * @param WP_Post $post Post object. 2022 * 1990 2023 * @return bool True on success, false on failure. 1991 2024 */ … … 2024 2057 * @param array $delete_activity_args Array of arguments for activity deletion. 2025 2058 * @param WP_Post $post Post object. 2026 * @param bool $activity Whether or not the activity 2027 * was successfully deleted. 2059 * @param bool $activity Whether or not the activity was successfully deleted. 2028 2060 */ 2029 2061 do_action( 'bp_activity_post_type_unpublished', $delete_activity_args, $post, $deleted ); … … 2044 2076 * @uses do_action() To call the 'bp_activity_comment_posted' hook. 2045 2077 * 2046 * @param array $args {2047 * @type int $idOptional. Pass an ID to update an existing comment.2048 * @type string $content The content of the comment.2049 * @type int $user_idOptional. The ID of the user making the comment.2050 * Defaults to the ID of the logged-in user.2051 * @type int $activity_id The ID of the "root" activity item, ie the oldest2052 * ancestor of the comment.2053 * @type int $parent_id Optional. The ID of the parent activity item, ie the2054 * item towhich the comment is an immediate reply. If not provided,2055 * this value defaults to the $activity_id.2078 * @param array|string $args { 2079 * @type int $id Optional. Pass an ID to update an existing comment. 2080 * @type string $content The content of the comment. 2081 * @type int $user_id Optional. The ID of the user making the comment. 2082 * Defaults to the ID of the logged-in user. 2083 * @type int $activity_id The ID of the "root" activity item, ie the oldest 2084 * ancestor of the comment. 2085 * @type int $parent_id Optional. The ID of the parent activity item, ie the item to 2086 * which the comment is an immediate reply. If not provided, 2087 * this value defaults to the $activity_id. 2056 2088 * } 2057 2089 * @return int|bool The ID of the comment on success, otherwise false. … … 2142 2174 * 2143 2175 * @param int $comment_id ID of the newly posted activity comment. 2144 * @param array $r Array of parsed comment arguments.2145 * @param int $activity ID of the activity item being commented on.2176 * @param array $r Array of parsed comment arguments. 2177 * @param int $activity ID of the activity item being commented on. 2146 2178 */ 2147 2179 do_action( 'bp_activity_comment_posted', $comment_id, $r, $activity ); … … 2165 2197 * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity} 2166 2198 * 2167 * @param array $args See BP_Activity_Activity::get() for description. 2199 * @param array|string $args See BP_Activity_Activity::get() for description. 2200 * 2168 2201 * @return int $activity_id The ID of the activity item found. 2169 2202 */ … … 2186 2219 * @since BuddyPress (1.2.0) 2187 2220 * 2188 * @param BP_Activity_Activity ID returned by BP_Activity_Activity get_id() method with provided arguments.2221 * @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments. 2189 2222 */ 2190 2223 return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( … … 2226 2259 * @uses wp_cache_delete() 2227 2260 * 2228 * @param array $args To delete specific activity items, use 2229 * $args = array( 'id' => $ids ); 2230 * Otherwise, to use filters for item deletion, the argument format is 2231 * the same as BP_Activity_Activity::get(). See that method for a description. 2261 * @param array|string $args To delete specific activity items, use 2262 * $args = array( 'id' => $ids ); Otherwise, to use 2263 * filters for item deletion, the argument format is 2264 * the same as BP_Activity_Activity::get(). 2265 * See that method for a description. 2266 * 2232 2267 * @return bool True on success, false on failure. 2233 2268 */ … … 2312 2347 * @uses bp_activity_delete() 2313 2348 * 2314 * @param array $args See BP_Activity_Activity::get for a description2315 * of accepted arguments.2349 * @param array|string $args See BP_Activity_Activity::get for a 2350 * description of accepted arguments. 2316 2351 * 2317 2352 * @return bool True on success, false on failure. … … 2337 2372 * @uses bp_activity_delete() 2338 2373 * 2339 * @param int ID of the activity item to be deleted. 2374 * @param int $activity_id ID of the activity item to be deleted. 2375 * 2340 2376 * @return bool True on success, false on failure. 2341 2377 */ … … 2354 2390 * @uses bp_activity_delete() 2355 2391 * 2356 * @param int $user_idThe user id.2357 * @param string $content The activity id.2392 * @param int $user_id The user id. 2393 * @param string $content The activity id. 2358 2394 * @param string $component The activity component. 2359 * @param string $type The activity type. 2395 * @param string $type The activity type. 2396 * 2360 2397 * @return bool True on success, false on failure. 2361 2398 */ … … 2379 2416 * @uses bp_activity_delete() 2380 2417 * 2381 * @param int $user_idThe user id.2418 * @param int $user_id The user id. 2382 2419 * @param string $component The activity component. 2420 * 2383 2421 * @return bool True on success, false on failure. 2384 2422 */ … … 2407 2445 * @param int $activity_id The ID of the "root" activity, ie the comment's 2408 2446 * oldest ancestor. 2409 * @param int $comment_id The ID of the comment to be deleted. 2447 * @param int $comment_id The ID of the comment to be deleted. 2448 * 2410 2449 * @return bool True on success, false on failure 2411 2450 */ … … 2420 2459 * @since BuddyPress (1.2.0) 2421 2460 * 2422 * @param bool $value Whether BuddyPress should continue or not.2461 * @param bool $value Whether BuddyPress should continue or not. 2423 2462 * @param int $activity_id ID of the root activity item being deleted. 2424 * @param int $comment_id ID of the comment being deleted.2463 * @param int $comment_id ID of the comment being deleted. 2425 2464 */ 2426 2465 if ( ! apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) ) { … … 2448 2487 * 2449 2488 * @param int $activity_id ID of the activity that has had a comment deleted from. 2450 * @param int $comment_id ID of the comment that was deleted.2489 * @param int $comment_id ID of the comment that was deleted. 2451 2490 */ 2452 2491 do_action( 'bp_activity_delete_comment', $activity_id, $comment_id ); … … 2465 2504 * 2466 2505 * @param int $activity_id The ID of the "root" activity, ie the 2467 * comment's oldest ancestor.2468 * @param int $comment_id The ID of the comment to be deleted.2506 * comment's oldest ancestor. 2507 * @param int $comment_id The ID of the comment to be deleted. 2469 2508 */ 2470 2509 function bp_activity_delete_children( $activity_id, $comment_id ) { … … 2502 2541 * @uses apply_filters_ref_array() To call the 'bp_activity_get_permalink' hook. 2503 2542 * 2504 * @param int $activity_id The unique id of the activity object. 2505 * @param object $activity_obj Optional. The activity object. 2543 * @param int $activity_id The unique id of the activity object. 2544 * @param object|bool $activity_obj Optional. The activity object. 2545 * 2506 2546 * @return string $link Permalink for the activity item. 2507 2547 */ … … 2556 2596 * 2557 2597 * @param int $user_id The ID of the user whose activity is being hidden. 2598 * 2558 2599 * @return bool True on success, false on failure. 2559 2600 */ … … 2579 2620 * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook 2580 2621 * 2581 * @param string $content The content of the activity item. 2582 * @param string $link Optional. The unescaped URL that the image should link 2583 * to. If absent, the image will not be a link. 2584 * @param array $args Optional. The args passed to the activity 2585 * creation function (eg bp_blogs_record_activity()). 2622 * @param string $content The content of the activity item. 2623 * @param string|bool $link Optional. The unescaped URL that the image should link 2624 * to. If absent, the image will not be a link. 2625 * @param array|bool $args Optional. The args passed to the activity 2626 * creation function (eg bp_blogs_record_activity()). 2627 * 2586 2628 * @return string $content The content with images stripped and replaced with a 2587 2629 * single thumb. … … 2639 2681 * @param string $content Activity content that had images replaced in. 2640 2682 * @param array $matches Array of all image tags found in the posted content. 2641 * @param array $args Arguments passed into function creating the activity update.2683 * @param array $args Arguments passed into function creating the activity update. 2642 2684 */ 2643 2685 return apply_filters( 'bp_activity_thumbnail_content_images', $content, $matches, $args ); … … 2656 2698 * @param array $activity The data passed to bp_activity_add() or the values 2657 2699 * from an Activity obj. 2700 * 2658 2701 * @return string 2659 2702 */ … … 2668 2711 } 2669 2712 2670 2671 2713 /** 2672 2714 * Filter the class name of the media extractor when creating an Activity summary. … … 2674 2716 * Use this filter to change the media extractor used to extract media info for the activity item. 2675 2717 * 2718 * @since BuddyPress (2.3.0) 2719 * 2676 2720 * @param string $extractor Class name. 2677 * @param string $content The content of the activity item. 2678 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj. 2679 * @since BuddyPress (2.3.0) 2721 * @param string $content The content of the activity item. 2722 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj. 2680 2723 */ 2681 2724 $extractor = apply_filters( 'bp_activity_create_summary_extractor_class', 'BP_Media_Extractor', $content, $activity ); … … 2685 2728 * Filter the arguments passed to the media extractor when creating an Activity summary. 2686 2729 * 2687 * @param array $args Array of bespoke data for the media extractor. 2688 * @param string $content The content of the activity item. 2689 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj. 2730 * @since BuddyPress (2.3.0) 2731 * 2732 * @param array $args Array of bespoke data for the media extractor. 2733 * @param string $content The content of the activity item. 2734 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj. 2690 2735 * @param BP_Media_Extractor $extractor The media extractor object. 2691 * @since BuddyPress (2.3.0)2692 2736 */ 2693 2737 $args = apply_filters( 'bp_activity_create_summary_extractor_args', $args, $content, $activity, $extractor ); … … 2735 2779 $use_media_type = 'images'; 2736 2780 $image_source = 'html'; 2737 2781 2738 2782 // Featured Image > Galleries > inline <img>. 2739 2783 if ( $has_feat_image ) { … … 2757 2801 * Filter the results of the media extractor when creating an Activity summary. 2758 2802 * 2759 * @param array $extracted_media Extracted media item. See {@link BP_Media_Extractor::extract()} for format.2760 * @param string $content Content of the activity item.2761 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj.2762 * @param array $media All results from the media extraction. See {@link BP_Media_Extractor::extract()} for format.2763 * @param string $use_media_type The kind of media item that was preferentially extracted.2764 * @param string $image_source If $use_media_type was "images", the preferential source of the image.2765 * Otherwise empty.2766 2803 * @since BuddyPress (2.3.0) 2804 * 2805 * @param array $extracted_media Extracted media item. See {@link BP_Media_Extractor::extract()} for format. 2806 * @param string $content Content of the activity item. 2807 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj. 2808 * @param array $media All results from the media extraction. 2809 * See {@link BP_Media_Extractor::extract()} for format. 2810 * @param string $use_media_type The kind of media item that was preferentially extracted. 2811 * @param string $image_source If $use_media_type was "images", the preferential source of the image. 2812 * Otherwise empty. 2767 2813 */ 2768 2814 $extracted_media = apply_filters( … … 2792 2838 * Filters the newly-generated summary for the activity item. 2793 2839 * 2794 * @param string $summary Activity summary HTML.2795 * @param string $content $content Content of the activity item.2796 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj.2797 * @param array $extracted_media Media item extracted. See {@link BP_Media_Extractor::extract()} for format.2798 2840 * @since BuddyPress (2.3.0) 2841 * 2842 * @param string $summary Activity summary HTML. 2843 * @param string $content Content of the activity item. 2844 * @param array $activity The data passed to bp_activity_add() or the values from an Activity obj. 2845 * @param array $extracted_media Media item extracted. See {@link BP_Media_Extractor::extract()} for format. 2799 2846 */ 2800 2847 return apply_filters( 'bp_activity_create_summary', $summary, $content, $activity, $extracted_media ); … … 2826 2873 * 2827 2874 * @param BP_Activity_Activity $activity The activity item to be spammed. 2828 * @param string $sourceOptional. Default is "by_a_person" (ie, a person has2829 * manually marked the activity as spam). BP core also accepts2830 * 'by_akismet'.2875 * @param string $source Optional. Default is "by_a_person" (ie, a person has 2876 * manually marked the activity as spam). BP core also 2877 * accepts 'by_akismet'. 2831 2878 */ 2832 2879 function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { … … 2861 2908 * 2862 2909 * @param BP_Activity_Activity $activity Activity item being marked as spam. 2863 * @param string $source Source of determination of spam status. For example2864 * "by_a_person" or "by_akismet".2910 * @param string $source Source of determination of spam status. For example 2911 * "by_a_person" or "by_akismet". 2865 2912 */ 2866 2913 do_action( 'bp_activity_mark_as_spam', $activity, $source ); … … 2872 2919 * @since BuddyPress (1.6.0) 2873 2920 * 2874 * @param BP_Activity_Activity $activity The activity item to be hammed. 2875 * @param string $sourceOptional. Default is "by_a_person" (ie, a person has2876 * manually marked the activity as spam). BP core also accepts2877 * 'by_akismet'.2921 * @param BP_Activity_Activity $activity The activity item to be hammed. Passed by reference. 2922 * @param string $source Optional. Default is "by_a_person" (ie, a person has 2923 * manually marked the activity as spam). BP core also accepts 2924 * 'by_akismet'. 2878 2925 */ 2879 2926 function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { … … 2908 2955 * 2909 2956 * @param BP_Activity_Activity $activity Activity item being marked as ham. 2910 * @param string $source Source of determination of ham status. For example2911 * "by_a_person" or "by_akismet".2957 * @param string $source Source of determination of ham status. For example 2958 * "by_a_person" or "by_akismet". 2912 2959 */ 2913 2960 do_action( 'bp_activity_mark_as_ham', $activity, $source ); … … 3015 3062 * @uses bp_activity_get_meta() 3016 3063 * 3017 * @param string $cache An empty string passed by BP_Embed::parse_oembed() for3018 * functions like this one to filter.3019 * @param int $idThe ID of the activity item.3064 * @param string $cache An empty string passed by BP_Embed::parse_oembed() for 3065 * functions like this one to filter. 3066 * @param int $id The ID of the activity item. 3020 3067 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). 3068 * 3021 3069 * @return mixed The cached embeds for this activity item. 3022 3070 */ … … 3035 3083 * @uses bp_activity_update_meta() 3036 3084 * 3037 * @param string $cache An empty string passed by BP_Embed::parse_oembed() for3038 * functions like this one to filter.3085 * @param string $cache An empty string passed by BP_Embed::parse_oembed() for 3086 * functions like this one to filter. 3039 3087 * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). 3040 * @param int $id The ID of the activity item. 3088 * @param int $id The ID of the activity item. 3089 * 3041 3090 * @return bool True on success, false on failure. 3042 3091 */
Note: See TracChangeset
for help on using the changeset viewer.