<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][9490] trunk/src/bp-groups/bp-groups-functions.php: Adds hooks documentation for bp-groups-functions.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/9490">9490</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/9490","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>tw2113</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-02-17 06:23:02 +0000 (Tue, 17 Feb 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Adds hooks documentation for bp-groups-functions.php.
See <a href="http://buddypress.trac.wordpress.org/ticket/5943">#5943</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpgroupsbpgroupsfunctionsphp">trunk/src/bp-groups/bp-groups-functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpgroupsbpgroupsfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-functions.php 2015-02-17 05:44:33 UTC (rev 9489)
+++ trunk/src/bp-groups/bp-groups-functions.php 2015-02-17 06:23:02 UTC (rev 9490)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,6 +56,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $group = new BP_Groups_Group( $r['group_id'], $group_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters a single group object.
+ *
+ * @since BuddyPress (1.2.0)
+ *
+ * @param BP_Groups_Group $group Single group object.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'groups_get_group', $group );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,12 +167,39 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the creation of a new group and a group creator needs to be made.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @param int $id ID of the newly created group.
+ * @param BP_Groups_Member $member Instance of the member who is assigned
+ * as group creator.
+ * @param BP_Groups_Group $group Instance of the group being created.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_create_group', $group->id, $member, $group );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Fires after the update of a group.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @param int $id ID of the updated group.
+ * @param BP_Groups_Group $group Instance of the group being updated.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_update_group', $group->id, $group );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the creation of a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $id ID of the newly created group.
+ * @param BP_Groups_Group $group Instance of the group being updated.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_created_group', $group->id, $group );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $group->id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,6 +293,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> groups_update_groupmeta( $group->id, 'invite_status', $invite_status );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> groups_update_groupmeta( $group->id, 'last_activity', bp_core_current_time() );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Fires after the update of a groups settings.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $id ID of the group that was updated.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_settings_updated', $group->id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,6 +316,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function groups_delete_group( $group_id ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires before the deletion of a group.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @param int $group_id ID of the group to be deleted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_before_delete_group', $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the group object
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -287,6 +336,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Remove all outstanding invites for this group
</span><span class="cx" style="display: block; padding: 0 10px"> groups_delete_all_group_invites( $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the deletion of a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group that was deleted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_delete_group', $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -382,6 +438,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> bp_core_add_message( __( 'You successfully left the group.', 'buddypress' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after a user leaves a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group.
+ * @param int $user_id ID of the user leaving the group.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_leave_group', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -441,6 +505,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Modify group meta
</span><span class="cx" style="display: block; padding: 0 10px"> groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after a user joins a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group.
+ * @param int $user_id ID of the user joining the group.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_join_group', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -634,6 +706,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => $r['orderby'],
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the collection of groups based on parsed parameters.
+ *
+ * @since BuddyPress (1.2.0)
+ *
+ *
+ * @param BP_Groups_Group $groups Object of found groups based on parameters.
+ * Passed by reference.
+ * @param array $r Array of parsed arguments used for group query.
+ * Passed by reference.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$r ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -709,6 +792,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ? $bp->groups->current_group
</span><span class="cx" style="display: block; padding: 0 10px"> : false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the BP_Groups_Group object corresponding to the current group.
+ *
+ * @since BuddyPress (1.5.0)
+ *
+ * @param BP_Groups_Group $current_group Current BP_Groups_Group object.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'groups_get_current_group', $current_group );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -737,6 +827,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $newburl = $newurl;
</span><span class="cx" style="display: block; padding: 0 10px"> $newsubdir = '/group-avatars/' . $group_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the avatar upload directory path for a given group.
+ *
+ * @since BuddyPress (1.1.0)
+ *
+ * @param array $value Array of parts related to the groups avatar upload directory.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> return apply_filters( 'groups_avatar_upload_dir', array( 'path' => $path, 'url' => $newurl, 'subdir' => $newsubdir, 'basedir' => $newbdir, 'baseurl' => $newburl, 'error' => false ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -837,15 +934,44 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $activity_action = sprintf( __( '%1$s posted an update in the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' );
</span><span class="cx" style="display: block; padding: 0 10px"> $activity_content = $content;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the action for the new group activity update.
+ *
+ * @since BuddyPress (1.2.0)
+ *
+ * @param string $activity_action The new group activity update.
+ */
+ $action = apply_filters( 'groups_activity_new_update_action', $activity_action );
+
+ /**
+ * Filters the content for the new group activity update.
+ *
+ * @since BuddyPress (1.2.0)
+ *
+ * @param string $activity_content The content of the update.
+ */
+ $content_filtered = apply_filters( 'groups_activity_new_update_content', $activity_content );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $activity_id = groups_record_activity( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'user_id' => $user_id,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'action' => apply_filters( 'groups_activity_new_update_action', $activity_action ),
- 'content' => apply_filters( 'groups_activity_new_update_content', $activity_content ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'action' => $action,
+ 'content' => $content_filtered,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'activity_update',
</span><span class="cx" style="display: block; padding: 0 10px"> 'item_id' => $group_id
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ /**
+ * Fires after posting of an Activity status update affiliated with a group.
+ *
+ * @since BuddyPress (1.2.0)
+ *
+ * @param string $content The content of the update.
+ * @param int $user_id ID of the user posting the update.
+ * @param int $group_id ID of the group being posted to.
+ * @param bool $activity_id Whether or not the activity recording succeeded.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'bp_groups_posted_update', $content, $user_id, $group_id, $activity_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $activity_id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -933,6 +1059,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !$invite->save() )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the creation of a new group invite.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param array $args Array of parsed arguments for the group invite.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_invite_user', $args );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -953,6 +1086,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !BP_Groups_Member::delete( $user_id, $group_id ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after uninviting a user from a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group being uninvited from.
+ * @param int $user_id ID of the user being uninvited.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_uninvite_user', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -998,6 +1139,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Modify group meta
</span><span class="cx" style="display: block; padding: 0 10px"> groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after a user has accepted a group invite.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $user_id ID of the user who accepted the group invite.
+ * @param int $group_id ID of the group being accepted to.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_accept_invite', $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1014,6 +1163,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! BP_Groups_Member::delete( $user_id, $group_id ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after a user rejects a group invitation.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $user_id ID of the user rejecting the invite.
+ * @param int $group_id ID of the group being rejected.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_reject_invite', $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1030,6 +1187,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! BP_Groups_Member::delete_invite( $user_id, $group_id ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the deletion of a group invitation.
+ *
+ * @since BuddyPress (1.9.0)
+ *
+ * @param int $user_id ID of the user whose invitation is being deleted.
+ * @param int $group_id ID of the group whose invitation is being deleted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_delete_invite', $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1060,6 +1225,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $member->save();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the sending of invites for a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group who's being invited to.
+ * @param array $invited_users Array of users being invited to the group.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_send_invites', $group_id, $invited_users );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1122,7 +1295,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Don't use this action. It's deprecated as of BuddyPress 1.6.
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_premote_member', $group_id, $user_id, $status );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Use this action instead.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires before the promotion of a user to a new status.
+ *
+ * @since BuddyPress (1.6.0)
+ *
+ * @param int $group_id ID of the group being promoted in.
+ * @param int $user_id ID of the user being promoted.
+ * @param string $status New status being promoted to.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_promote_member', $group_id, $user_id, $status );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $member->promote( $status );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1142,6 +1323,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $member = new BP_Groups_Member( $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires before the demotion of a user to 'member'.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group being demoted in.
+ * @param int $user_id ID of the user being demoted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_demote_member', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $member->demote();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1161,6 +1350,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $member = new BP_Groups_Member( $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires before the banning of a member from a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group being banned from.
+ * @param int $user_id ID of the user being banned.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_ban_member', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $member->ban();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1180,6 +1377,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $member = new BP_Groups_Member( $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires before the unbanning of a member from a group.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $group_id ID of the group being unbanned from.
+ * @param int $user_id ID of the user being unbanned.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_unban_member', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $member->unban();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1201,6 +1406,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $member = new BP_Groups_Member( $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires before the removal of a member from a group.
+ *
+ * @since BuddyPress (1.2.6)
+ *
+ * @param int $group_id ID of the group being removed from.
+ * @param int $user_id ID of the user being removed.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_remove_member', $group_id, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $member->remove();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1248,6 +1461,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 0, $count = count( $admins ); $i < $count; ++$i )
</span><span class="cx" style="display: block; padding: 0 10px"> groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the creation of a new membership request.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $requesting_user_id ID of the user requesting membership.
+ * @param array $admins Array of group admins.
+ * @param int $group_id ID of the group being requested to.
+ * @param int $requesting_user->id ID of the user requesting membership.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1286,6 +1509,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> groups_delete_invite( $membership->user_id, $membership->group_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after a group membership request has been accepted.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $user_id ID of the user who accepted membership.
+ * @param int $group_id ID of the group that was accepted membership to.
+ * @param bool $value If membership was accepted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_membership_accepted', $membership->user_id, $membership->group_id, true );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1307,6 +1539,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after a group membership request has been rejected.
+ *
+ * @since BuddyPress (1.0.0)
+ *
+ * @param int $user_id ID of the user who rejected membership.
+ * @param int $group_id ID of the group that was rejected membership to.
+ * @param bool $value If membership was accepted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_membership_rejected', $membership->user_id, $membership->group_id, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1361,6 +1602,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $user_ids as $user_id )
</span><span class="cx" style="display: block; padding: 0 10px"> groups_accept_membership_request( false, $user_id, $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the acceptance of all pending membership requests to a group.
+ *
+ * @since BuddyPress (1.0.2)
+ *
+ * @param int $group_id ID of the group whose pending memberships were accepted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_accept_all_pending_membership_requests', $group_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1479,6 +1727,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function groups_remove_data_for_user( $user_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> BP_Groups_Member::delete_all_for_user( $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Fires after the deletion of all data for a user.
+ *
+ * @since BuddyPress (1.1.0)
+ *
+ * @param int $user_id ID of the user whose data is being deleted.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> do_action( 'groups_remove_data_for_user', $user_id );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' );
</span></span></pre>
</div>
</div>
</body>
</html>