Skip to content

Instantly share code, notes, and snippets.

View mjhmatt's full-sized avatar

Matt Hill mjhmatt

  • Sydney, Australia
View GitHub Profile
@mjhmatt
mjhmatt / class-bp-groups-member.php
Last active October 18, 2017 10:15
BP Group Member Class
public function save() {
$this->user_id = apply_filters( 'groups_member_user_id_before_save', $this->user_id, $this->id );
$this->group_id = apply_filters( 'groups_member_group_id_before_save', $this->group_id, $this->id );
$this->inviter_id = apply_filters( 'groups_member_inviter_id_before_save', $this->inviter_id, $this->id );
$this->is_admin = apply_filters( 'groups_member_is_admin_before_save', $this->is_admin, $this->id );
$this->is_mod = apply_filters( 'groups_member_is_mod_before_save', $this->is_mod, $this->id );
$this->is_banned = apply_filters( 'groups_member_is_banned_before_save', $this->is_banned, $this->id );
$this->user_title = apply_filters( 'groups_member_user_title_before_save', $this->user_title, $this->id );
$this->date_modified = apply_filters( 'groups_member_date_modified_before_save', $this->date_modified, $this->id );
$this->is_confirmed = apply_filters( 'groups_member_
@mjhmatt
mjhmatt / migrate.php
Created October 18, 2017 10:12
Group Invite
$groups = $mysqli->query("
SELECT og_membership.etid, og.gid AS 'group'
FROM og_membership
LEFT JOIN og on og_membership.gid=og.etid
WHERE og_membership.entity_type = 'user'"
);
$i=0;
while($data = mysqli_fetch_array($groups)){