Changeset 9398 for trunk/src/bp-members/bp-members-functions.php
- Timestamp:
- 01/22/2015 01:31:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-functions.php
r9371 r9398 786 786 remove_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' ); 787 787 788 // Determine if we are on an admin page 789 $is_admin = is_admin(); 790 if ( $is_admin && ! defined( 'DOING_AJAX' ) ) { 791 $is_admin = (bool) ( buddypress()->members->admin->user_page !== get_current_screen()->id ); 792 } 793 794 // When marking as spam in the Dashboard, these actions are handled by WordPress 788 // force the cleanup of WordPress content and status for multisite configs 795 789 if ( $do_wp_cleanup ) { 796 790 … … 813 807 update_user_status( $user_id, 'spam', $is_spam ); 814 808 } 815 816 // Always set single site status 817 $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) ); 818 809 } 810 811 // Update the user status 812 $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) ); 813 814 // Clean user cache 815 clean_user_cache( $user_id ); 816 817 if ( ! is_multisite() ) { 819 818 // Call multisite actions in single site mode for good measure 820 if ( !is_multisite() ) { 821 if ( true === $is_spam ) { 822 823 /** 824 * Fires at end of processing spammer in Dashboard if not multisite and user is spam. 825 * 826 * @since BuddyPress (1.5.0) 827 * 828 * @param int $value Displayed user ID. 829 */ 830 do_action( 'make_spam_user', bp_displayed_user_id() ); 831 } else { 832 833 /** 834 * Fires at end of processing spammer in Dashboard if not multisite and user is not spam. 835 * 836 * @since BuddyPress (1.5.0) 837 * 838 * @param int $value Displayed user ID. 839 */ 840 do_action( 'make_ham_user', bp_displayed_user_id() ); 841 } 842 843 819 if ( true === $is_spam ) { 820 821 /** 822 * Fires at end of processing spammer in Dashboard if not multisite and user is spam. 823 * 824 * @since BuddyPress (1.5.0) 825 * 826 * @param int $value user ID. 827 */ 828 do_action( 'make_spam_user', $user_id ); 829 } else { 830 831 /** 832 * Fires at end of processing spammer in Dashboard if not multisite and user is not spam. 833 * 834 * @since BuddyPress (1.5.0) 835 * 836 * @param int $value user ID. 837 */ 838 do_action( 'make_ham_user', $user_id ); 844 839 } 845 840 }
Note: See TracChangeset
for help on using the changeset viewer.