Skip to:
Content

BuddyPress.org

Changeset 2903


Ignore:
Timestamp:
04/05/2010 01:20:02 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2272 and update phpdoc; props francescolaffi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core.php

    r2901 r2903  
    16931693 * @package BuddyPress Core
    16941694 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
    1695  * @uses check_admin_referer() Checks for a valid security nonce.
    16961695 * @uses is_site_admin() Checks to see if the user is a site administrator.
    1697  * @uses wpmu_delete_user() Deletes a user from the system.
     1696 * @uses wpmu_delete_user() Deletes a user from the system on multisite installs.
     1697 * @uses wp_delete_user() Deletes a user from the system on singlesite installs.
     1698 * @uses get_site_option Checks if account deletion is allowed
    16981699 */
    16991700function bp_core_delete_account( $user_id = false ) {
     
    17071708        return false;
    17081709
    1709     /* Site admins should not be allowed to be deleted */
    1710     if ( bp_core_is_multisite() && is_site_admin( bp_core_get_username( $user_id ) ) )
    1711         return false;
    1712 
    1713     if ( bp_core_is_multisite() && function_exists('wpmu_delete_user') ) {
     1710    /* Specifically handle multi-site environment */
     1711    if ( bp_core_is_multisite() ) {
     1712        /* Site admins cannot be deleted */
     1713        if ( is_site_admin( bp_core_get_username( $user_id ) ) )
     1714            return false;
     1715
    17141716        require_once( ABSPATH . '/wp-admin/includes/mu.php' );
    17151717        require_once( ABSPATH . '/wp-admin/includes/user.php' );
     
    17181720    }
    17191721
     1722    /* Single site user deletion */
    17201723    require_once( ABSPATH . '/wp-admin/includes/user.php' );
    17211724    return wp_delete_user( $user_id );
Note: See TracChangeset for help on using the changeset viewer.