Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/27/2014 06:02:00 PM (5 years ago)
Author:
boonebgorges
Message:

Enable Spam admin tools on non-MS users.php Dashboard panel

This change brings non-MS installations of BuddyPress closer to the
functionality that is native to WP Multisite, with respect to the ability to
manage spam/ham users from the Users panel. It also addresses a shortcoming
whereby admins on non-MS sites would have no way at all to spam/unspam users
if the Settings component was disabled, since the front-end Spam tools are in
that optional component.

Fixes #5113

Props imath, r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-functions.php

    r8170 r8174  
    602602 * @param int $user_id The ID of the user being spammed/hammed.
    603603 * @param string $status 'spam' if being marked as spam, 'ham' otherwise.
    604  */
    605 function bp_core_process_spammer_status( $user_id, $status ) {
     604 * @param bool $do_wp_cleanup True to force the cleanup of WordPress content
     605 *        and status, otherwise false. Generally, this should only be false if
     606 *        WordPress is expected to have performed this cleanup independently,
     607 *        as when hooked to 'make_spam_user'.
     608 * @return bool True on success, false on failure.
     609 */
     610function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = true ) {
    606611    global $wpdb;
    607612
     
    632637
    633638    // When marking as spam in the Dashboard, these actions are handled by WordPress
    634     if ( ! $is_admin ) {
     639    if ( $do_wp_cleanup ) {
    635640
    636641        // Get the blogs for the user
     
    690695 */
    691696function bp_core_mark_user_spam_admin( $user_id ) {
    692     bp_core_process_spammer_status( $user_id, 'spam' );
     697    bp_core_process_spammer_status( $user_id, 'spam', false );
    693698}
    694699add_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' );
     
    702707 */
    703708function bp_core_mark_user_ham_admin( $user_id ) {
    704     bp_core_process_spammer_status( $user_id, 'ham' );
     709    bp_core_process_spammer_status( $user_id, 'ham', false );
    705710}
    706711add_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' );
Note: See TracChangeset for help on using the changeset viewer.