Changeset 10322 for trunk/src/bp-members/bp-members-actions.php
- Timestamp:
- 11/02/2015 01:58:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-actions.php
r10149 r10322 1 1 <?php 2 2 /** 3 * BuddyPress Members Actions 3 * BuddyPress Members Actions. 4 4 * 5 5 * Action functions are exactly the same as screen functions, however they do not … … 28 28 29 29 // Only super admins can currently spam users (but they can't spam 30 // themselves) 30 // themselves). 31 31 if ( ! is_super_admin() || bp_is_my_profile() ) { 32 32 return; 33 33 } 34 34 35 // Use displayed user if it's not yourself 35 // Use displayed user if it's not yourself. 36 36 if ( empty( $user_id ) ) 37 37 $user_id = bp_displayed_user_id(); … … 39 39 if ( bp_is_current_component( 'admin' ) && ( in_array( bp_current_action(), array( 'mark-spammer', 'unmark-spammer' ) ) ) ) { 40 40 41 // Check the nonce 41 // Check the nonce. 42 42 check_admin_referer( 'mark-unmark-spammer' ); 43 43 44 // To spam or not to spam 44 // To spam or not to spam. 45 45 $status = bp_is_current_action( 'mark-spammer' ) ? 'spam' : 'ham'; 46 46 47 // The heavy lifting 47 // The heavy lifting. 48 48 bp_core_process_spammer_status( $user_id, $status ); 49 49 50 // Add feedback message. @todo - Error reporting 50 // Add feedback message. @todo - Error reporting. 51 51 if ( 'spam' == $status ) { 52 52 bp_core_add_message( __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) ); … … 59 59 do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam ); 60 60 61 // Redirect back to where we came from 61 // Redirect back to where we came from. 62 62 bp_core_redirect( wp_get_referer() ); 63 63 } 64 64 } 65 // Unhooked in 1.6.0 - moved to settings 66 //add_action( 'bp_actions', 'bp_core_action_set_spammer_status' ); 65 66 /* 67 * Unhooked in 1.6.0 - moved to settings. 68 * add_action( 'bp_actions', 'bp_core_action_set_spammer_status' ); 69 */ 67 70 68 71 /** … … 78 81 if ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) { 79 82 80 // Check the nonce 83 // Check the nonce. 81 84 check_admin_referer( 'delete-user' ); 82 85 … … 99 102 } 100 103 } 101 // Unhooked in 1.6.0 - moved to settings 102 //add_action( 'bp_actions', 'bp_core_action_delete_user' ); 104 105 /* 106 * Unhooked in 1.6.0 - moved to settings 107 * add_action( 'bp_actions', 'bp_core_action_delete_user' ); 108 */ 103 109 104 110 /**
Note: See TracChangeset
for help on using the changeset viewer.