Changeset 5829 for trunk/bp-members/bp-members-functions.php
- Timestamp:
- 02/23/2012 06:18:39 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-functions.php
r5803 r5829 489 489 * Processes a spammed or unspammed user 490 490 * 491 * This function is called in t woways:492 * - in bp_ core_action_set_spammer_status() (when spammingfrom the front-end)493 * - by bp_core_mark_user_spam_admin() or bp_core_mark_user_ham_admin() (when spamming from the494 * Dashboard)495 * 496 * @since 1.6491 * This function is called in three ways: 492 * - in bp_settings_action_capabilities() (from the front-end) 493 * - by bp_core_mark_user_spam_admin() (from wp-admin) 494 * - bp_core_mark_user_ham_admin() (from wp-admin) 495 * 496 * @since BuddyPress (1.6) 497 497 * 498 498 * @param int $user_id The user being spammed/hammed … … 519 519 } 520 520 521 $is_spam = 'spam' == $status;521 $is_spam = ( 'spam' == $status ); 522 522 523 523 // Only you can prevent infinite loops 524 524 remove_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' ); 525 remove_action( 'make_ham_user', 'bp_core_mark_user_ham_admin');525 remove_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' ); 526 526 527 527 // When marking as spam in the Dashboard, these actions are handled by WordPress 528 528 if ( !is_admin() ) { 529 529 530 // Get the blogs for the user 530 531 $blogs = get_blogs_of_user( $user_id, true ); … … 551 552 // Call multisite actions in single site mode for good measure 552 553 if ( !is_multisite() ) { 553 $wp_action = $is_spam? 'make_spam_user' : 'make_ham_user';554 $wp_action = ( true === $is_spam ) ? 'make_spam_user' : 'make_ham_user'; 554 555 do_action( $wp_action, bp_displayed_user_id() ); 555 556 } … … 557 558 558 559 // Hide this user's activity 559 if ( $is_spam&& bp_is_active( 'activity' ) ) {560 if ( ( true === $is_spam ) && bp_is_active( 'activity' ) ) { 560 561 bp_activity_hide_user_activity( $user_id ); 561 562 } 562 563 563 564 // We need a special hook for is_spam so that components can delete data at spam time 564 $bp_action = $is_spam? 'bp_make_spam_user' : 'bp_make_ham_user';565 $bp_action = ( true === $is_spam ) ? 'bp_make_spam_user' : 'bp_make_ham_user'; 565 566 do_action( $bp_action, $user_id ); 566 567 … … 574 575 * Hook to WP's make_spam_user and run our custom BP spam functions 575 576 * 576 * @since 1.6577 * @since BuddyPress (1.6) 577 578 * 578 579 * @param int $user_id The user id passed from the make_spam_user hook … … 586 587 * Hook to WP's make_ham_user and run our custom BP spam functions 587 588 * 588 * @since 1.6589 * @since BuddyPress (1.6) 589 590 * 590 591 * @param int $user_id The user id passed from the make_ham_user hook … … 751 752 * 752 753 * @package BuddyPress Core 753 * @global object $bp Global BuddyPress settings object754 * @uses bp_current_user_can() Checks to see if the user is a site administrator.755 754 * @uses wpmu_delete_user() Deletes a user from the system on multisite installs. 756 755 * @uses wp_delete_user() Deletes a user from the system on singlesite installs. 757 756 */ 758 757 function bp_core_delete_account( $user_id = 0 ) { 759 global $bp, $wp_version; 760 761 if ( !$user_id ) 758 759 if ( empty( $user_id ) ) 762 760 $user_id = bp_loggedin_user_id(); 763 761 764 762 // Make sure account deletion is not disabled 765 if ( !empty( $bp->site_options['bp-disable-account-deletion'] ) && !bp_current_user_can( 'bp_moderate') )763 if ( bp_disable_account_deletion() ) 766 764 return false; 767 765 … … 772 770 // Specifically handle multi-site environment 773 771 if ( is_multisite() ) { 774 if ( $wp_version >= '3.0' ) 775 require( ABSPATH . '/wp-admin/includes/ms.php' ); 776 else 777 require( ABSPATH . '/wp-admin/includes/mu.php' ); 778 772 require( ABSPATH . '/wp-admin/includes/ms.php' ); 779 773 require( ABSPATH . '/wp-admin/includes/user.php' ); 780 774
Note: See TracChangeset
for help on using the changeset viewer.