Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 02:14:07 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Remove unneeded globals and clean up some code in XProfile component. See #3989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-activity.php

    r5437 r5699  
    11<?php
     2
    23/**
    34 * BuddyPress XProfile Activity & Notification Functions
     
    78 *
    89 * @package BuddyPress
    9  * @subpackage XProfile
     10 * @subpackage XProfileActivity
    1011 */
    1112
     
    2930 * it will show in the users activity stream (if installed)
    3031 *
    31  * @package BuddyPress XProfile
     32 * @package BuddyPress
     33 * @subpackage XProfileActivity
    3234 * @param $args Array containing all variables used after extract() call
    3335 * @global $bp The global BuddyPress settings variable created in bp_core_current_times()
     
    3537 */
    3638function xprofile_record_activity( $args = '' ) {
    37     global $bp;
    3839
    3940    if ( !bp_is_active( 'activity' ) )
    4041        return false;
     42
     43    global $bp;
    4144
    4245    $defaults = array (
     
    8083 */
    8184function xprofile_delete_activity( $args = '' ) {
     85
     86    if ( ! bp_is_active( 'activity' ) )
     87        return false;
     88
    8289    global $bp;
    8390
    84     if ( bp_is_active( 'activity' ) ) {
     91    extract( $args );
    8592
    86         extract( $args );
    87 
    88         bp_activity_delete_by_item_id( array(
    89             'item_id'           => $item_id,
    90             'component'         => $bp->profile->id,
    91             'type'              => $type,
    92             'user_id'           => $user_id,
    93             'secondary_item_id' => $secondary_item_id
    94         ) );
    95     }
     93    bp_activity_delete_by_item_id( array(
     94        'item_id'           => $item_id,
     95        'component'         => $bp->profile->id,
     96        'type'              => $type,
     97        'user_id'           => $user_id,
     98        'secondary_item_id' => $secondary_item_id
     99    ) );
    96100}
    97101
     
    113117 */
    114118function bp_xprofile_new_avatar_activity() {
    115     global $bp;
    116119
    117120    if ( !bp_is_active( 'activity' ) )
     
    130133}
    131134add_action( 'xprofile_avatar_uploaded', 'bp_xprofile_new_avatar_activity' );
     135
    132136?>
Note: See TracChangeset for help on using the changeset viewer.