Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/24/2014 04:35:52 AM (12 years ago)
Author:
imath
Message:

Move the 'new_member' activity type into the Members component

Since BuddyPress 1.1, the 'new_member' type was attached to the xProfile component. In version 2.2, we are moving it into the Members one. Once the user will have upgraded to this version, every existing 'new_member' activity items will have their component updated to the 'members' one and each time a new member will register, the 'new_member' activity will be attached to the members component.

Props boonebgorges, DJPaul

Fixes #5807

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-update.php

    r9182 r9273  
    399399 *
    400400 * - Add messages meta table
     401 * - Update the component field of the 'new members' activity type
    401402 *
    402403 * @since BuddyPress (2.2.0)
     
    406407                bp_core_install_private_messaging();
    407408        }
     409
     410        if ( bp_is_active( 'activity' ) ) {
     411                bp_migrate_new_member_activity_component();
     412        }
     413}
     414
     415/**
     416 * Updates the component field for new_members type.
     417 *
     418 * @since BuddyPress (2.2.0)
     419 *
     420 * @global $wpdb
     421 * @uses   buddypress()
     422 *
     423 */
     424function bp_migrate_new_member_activity_component() {
     425        global $wpdb;
     426        $bp = buddypress();
     427
     428        // Update the component for the new_member type
     429        $wpdb->update(
     430                // Activity table
     431                $bp->members->table_name_last_activity,
     432                array(
     433                        'component' => $bp->members->id,
     434                ),
     435                array(
     436                        'component' => 'xprofile',
     437                        'type'      => 'new_member',
     438                ),
     439                // Data sanitization format
     440                array(
     441                        '%s',
     442                ),
     443                // WHERE sanitization format
     444                array(
     445                        '%s',
     446                        '%s'
     447                )
     448        );
    408449}
    409450
Note: See TracChangeset for help on using the changeset viewer.