Changeset 9490
- Timestamp:
- 02/17/2015 06:23:02 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r9471 r9490 57 57 $group = new BP_Groups_Group( $r['group_id'], $group_args ); 58 58 59 /** 60 * Filters a single group object. 61 * 62 * @since BuddyPress (1.2.0) 63 * 64 * @param BP_Groups_Group $group Single group object. 65 */ 59 66 return apply_filters( 'groups_get_group', $group ); 60 67 } … … 161 168 groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() ); 162 169 170 /** 171 * Fires after the creation of a new group and a group creator needs to be made. 172 * 173 * @since BuddyPress (1.5.0) 174 * 175 * @param int $id ID of the newly created group. 176 * @param BP_Groups_Member $member Instance of the member who is assigned 177 * as group creator. 178 * @param BP_Groups_Group $group Instance of the group being created. 179 */ 163 180 do_action( 'groups_create_group', $group->id, $member, $group ); 164 181 165 182 } else { 183 184 /** 185 * Fires after the update of a group. 186 * 187 * @since BuddyPress (1.5.0) 188 * 189 * @param int $id ID of the updated group. 190 * @param BP_Groups_Group $group Instance of the group being updated. 191 */ 166 192 do_action( 'groups_update_group', $group->id, $group ); 167 193 } 168 194 195 /** 196 * Fires after the creation of a group. 197 * 198 * @since BuddyPress (1.0.0) 199 * 200 * @param int $id ID of the newly created group. 201 * @param BP_Groups_Group $group Instance of the group being updated. 202 */ 169 203 do_action( 'groups_created_group', $group->id, $group ); 170 204 … … 260 294 261 295 groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() ); 296 297 /** 298 * Fires after the update of a groups settings. 299 * 300 * @since BuddyPress (1.0.0) 301 * 302 * @param int $id ID of the group that was updated. 303 */ 262 304 do_action( 'groups_settings_updated', $group->id ); 263 305 … … 275 317 function groups_delete_group( $group_id ) { 276 318 319 /** 320 * Fires before the deletion of a group. 321 * 322 * @since BuddyPress (1.5.0) 323 * 324 * @param int $group_id ID of the group to be deleted. 325 */ 277 326 do_action( 'groups_before_delete_group', $group_id ); 278 327 … … 288 337 groups_delete_all_group_invites( $group_id ); 289 338 339 /** 340 * Fires after the deletion of a group. 341 * 342 * @since BuddyPress (1.0.0) 343 * 344 * @param int $group_id ID of the group that was deleted. 345 */ 290 346 do_action( 'groups_delete_group', $group_id ); 291 347 … … 383 439 bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) ); 384 440 441 /** 442 * Fires after a user leaves a group. 443 * 444 * @since BuddyPress (1.0.0) 445 * 446 * @param int $group_id ID of the group. 447 * @param int $user_id ID of the user leaving the group. 448 */ 385 449 do_action( 'groups_leave_group', $group_id, $user_id ); 386 450 … … 442 506 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 443 507 508 /** 509 * Fires after a user joins a group. 510 * 511 * @since BuddyPress (1.0.0) 512 * 513 * @param int $group_id ID of the group. 514 * @param int $user_id ID of the user joining the group. 515 */ 444 516 do_action( 'groups_join_group', $group_id, $user_id ); 445 517 … … 635 707 ) ); 636 708 709 /** 710 * Filters the collection of groups based on parsed parameters. 711 * 712 * @since BuddyPress (1.2.0) 713 * 714 * 715 * @param BP_Groups_Group $groups Object of found groups based on parameters. 716 * Passed by reference. 717 * @param array $r Array of parsed arguments used for group query. 718 * Passed by reference. 719 */ 637 720 return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$r ) ); 638 721 } … … 710 793 : false; 711 794 795 /** 796 * Filters the BP_Groups_Group object corresponding to the current group. 797 * 798 * @since BuddyPress (1.5.0) 799 * 800 * @param BP_Groups_Group $current_group Current BP_Groups_Group object. 801 */ 712 802 return apply_filters( 'groups_get_current_group', $current_group ); 713 803 } … … 738 828 $newsubdir = '/group-avatars/' . $group_id; 739 829 830 /** 831 * Filters the avatar upload directory path for a given group. 832 * 833 * @since BuddyPress (1.1.0) 834 * 835 * @param array $value Array of parts related to the groups avatar upload directory. 836 */ 740 837 return apply_filters( 'groups_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) ); 741 838 } … … 838 935 $activity_content = $content; 839 936 937 /** 938 * Filters the action for the new group activity update. 939 * 940 * @since BuddyPress (1.2.0) 941 * 942 * @param string $activity_action The new group activity update. 943 */ 944 $action = apply_filters( 'groups_activity_new_update_action', $activity_action ); 945 946 /** 947 * Filters the content for the new group activity update. 948 * 949 * @since BuddyPress (1.2.0) 950 * 951 * @param string $activity_content The content of the update. 952 */ 953 $content_filtered = apply_filters( 'groups_activity_new_update_content', $activity_content ); 954 840 955 $activity_id = groups_record_activity( array( 841 956 'user_id' => $user_id, 842 'action' => apply_filters( 'groups_activity_new_update_action', $activity_action ),843 'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ),957 'action' => $action, 958 'content' => $content_filtered, 844 959 'type' => 'activity_update', 845 960 'item_id' => $group_id … … 847 962 848 963 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 964 965 /** 966 * Fires after posting of an Activity status update affiliated with a group. 967 * 968 * @since BuddyPress (1.2.0) 969 * 970 * @param string $content The content of the update. 971 * @param int $user_id ID of the user posting the update. 972 * @param int $group_id ID of the group being posted to. 973 * @param bool $activity_id Whether or not the activity recording succeeded. 974 */ 849 975 do_action( 'bp_groups_posted_update', $content, $user_id, $group_id, $activity_id ); 850 976 … … 934 1060 return false; 935 1061 1062 /** 1063 * Fires after the creation of a new group invite. 1064 * 1065 * @since BuddyPress (1.0.0) 1066 * 1067 * @param array $args Array of parsed arguments for the group invite. 1068 */ 936 1069 do_action( 'groups_invite_user', $args ); 937 1070 } … … 954 1087 return false; 955 1088 1089 /** 1090 * Fires after uninviting a user from a group. 1091 * 1092 * @since BuddyPress (1.0.0) 1093 * 1094 * @param int $group_id ID of the group being uninvited from. 1095 * @param int $user_id ID of the user being uninvited. 1096 */ 956 1097 do_action( 'groups_uninvite_user', $group_id, $user_id ); 957 1098 … … 999 1140 groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); 1000 1141 1142 /** 1143 * Fires after a user has accepted a group invite. 1144 * 1145 * @since BuddyPress (1.0.0) 1146 * 1147 * @param int $user_id ID of the user who accepted the group invite. 1148 * @param int $group_id ID of the group being accepted to. 1149 */ 1001 1150 do_action( 'groups_accept_invite', $user_id, $group_id ); 1002 1151 … … 1015 1164 return false; 1016 1165 1166 /** 1167 * Fires after a user rejects a group invitation. 1168 * 1169 * @since BuddyPress (1.0.0) 1170 * 1171 * @param int $user_id ID of the user rejecting the invite. 1172 * @param int $group_id ID of the group being rejected. 1173 */ 1017 1174 do_action( 'groups_reject_invite', $user_id, $group_id ); 1018 1175 … … 1031 1188 return false; 1032 1189 1190 /** 1191 * Fires after the deletion of a group invitation. 1192 * 1193 * @since BuddyPress (1.9.0) 1194 * 1195 * @param int $user_id ID of the user whose invitation is being deleted. 1196 * @param int $group_id ID of the group whose invitation is being deleted. 1197 */ 1033 1198 do_action( 'groups_delete_invite', $user_id, $group_id ); 1034 1199 … … 1061 1226 } 1062 1227 1228 /** 1229 * Fires after the sending of invites for a group. 1230 * 1231 * @since BuddyPress (1.0.0) 1232 * 1233 * @param int $group_id ID of the group who's being invited to. 1234 * @param array $invited_users Array of users being invited to the group. 1235 */ 1063 1236 do_action( 'groups_send_invites', $group_id, $invited_users ); 1064 1237 } … … 1123 1296 do_action( 'groups_premote_member', $group_id, $user_id, $status ); 1124 1297 1125 // Use this action instead. 1298 /** 1299 * Fires before the promotion of a user to a new status. 1300 * 1301 * @since BuddyPress (1.6.0) 1302 * 1303 * @param int $group_id ID of the group being promoted in. 1304 * @param int $user_id ID of the user being promoted. 1305 * @param string $status New status being promoted to. 1306 */ 1126 1307 do_action( 'groups_promote_member', $group_id, $user_id, $status ); 1127 1308 … … 1143 1324 $member = new BP_Groups_Member( $user_id, $group_id ); 1144 1325 1326 /** 1327 * Fires before the demotion of a user to 'member'. 1328 * 1329 * @since BuddyPress (1.0.0) 1330 * 1331 * @param int $group_id ID of the group being demoted in. 1332 * @param int $user_id ID of the user being demoted. 1333 */ 1145 1334 do_action( 'groups_demote_member', $group_id, $user_id ); 1146 1335 … … 1162 1351 $member = new BP_Groups_Member( $user_id, $group_id ); 1163 1352 1353 /** 1354 * Fires before the banning of a member from a group. 1355 * 1356 * @since BuddyPress (1.0.0) 1357 * 1358 * @param int $group_id ID of the group being banned from. 1359 * @param int $user_id ID of the user being banned. 1360 */ 1164 1361 do_action( 'groups_ban_member', $group_id, $user_id ); 1165 1362 … … 1181 1378 $member = new BP_Groups_Member( $user_id, $group_id ); 1182 1379 1380 /** 1381 * Fires before the unbanning of a member from a group. 1382 * 1383 * @since BuddyPress (1.0.0) 1384 * 1385 * @param int $group_id ID of the group being unbanned from. 1386 * @param int $user_id ID of the user being unbanned. 1387 */ 1183 1388 do_action( 'groups_unban_member', $group_id, $user_id ); 1184 1389 … … 1202 1407 $member = new BP_Groups_Member( $user_id, $group_id ); 1203 1408 1409 /** 1410 * Fires before the removal of a member from a group. 1411 * 1412 * @since BuddyPress (1.2.6) 1413 * 1414 * @param int $group_id ID of the group being removed from. 1415 * @param int $user_id ID of the user being removed. 1416 */ 1204 1417 do_action( 'groups_remove_member', $group_id, $user_id ); 1205 1418 … … 1249 1462 groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id ); 1250 1463 1464 /** 1465 * Fires after the creation of a new membership request. 1466 * 1467 * @since BuddyPress (1.0.0) 1468 * 1469 * @param int $requesting_user_id ID of the user requesting membership. 1470 * @param array $admins Array of group admins. 1471 * @param int $group_id ID of the group being requested to. 1472 * @param int $requesting_user->id ID of the user requesting membership. 1473 */ 1251 1474 do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id ); 1252 1475 … … 1287 1510 } 1288 1511 1512 /** 1513 * Fires after a group membership request has been accepted. 1514 * 1515 * @since BuddyPress (1.0.0) 1516 * 1517 * @param int $user_id ID of the user who accepted membership. 1518 * @param int $group_id ID of the group that was accepted membership to. 1519 * @param bool $value If membership was accepted. 1520 */ 1289 1521 do_action( 'groups_membership_accepted', $membership->user_id, $membership->group_id, true ); 1290 1522 … … 1308 1540 } 1309 1541 1542 /** 1543 * Fires after a group membership request has been rejected. 1544 * 1545 * @since BuddyPress (1.0.0) 1546 * 1547 * @param int $user_id ID of the user who rejected membership. 1548 * @param int $group_id ID of the group that was rejected membership to. 1549 * @param bool $value If membership was accepted. 1550 */ 1310 1551 do_action( 'groups_membership_rejected', $membership->user_id, $membership->group_id, false ); 1311 1552 … … 1362 1603 groups_accept_membership_request( false, $user_id, $group_id ); 1363 1604 1605 /** 1606 * Fires after the acceptance of all pending membership requests to a group. 1607 * 1608 * @since BuddyPress (1.0.2) 1609 * 1610 * @param int $group_id ID of the group whose pending memberships were accepted. 1611 */ 1364 1612 do_action( 'groups_accept_all_pending_membership_requests', $group_id ); 1365 1613 … … 1480 1728 BP_Groups_Member::delete_all_for_user( $user_id ); 1481 1729 1730 /** 1731 * Fires after the deletion of all data for a user. 1732 * 1733 * @since BuddyPress (1.1.0) 1734 * 1735 * @param int $user_id ID of the user whose data is being deleted. 1736 */ 1482 1737 do_action( 'groups_remove_data_for_user', $user_id ); 1483 1738 }
Note: See TracChangeset
for help on using the changeset viewer.