Changeset 11688 for trunk/src/bp-messages/bp-messages-actions.php
- Timestamp:
- 09/07/2017 11:00:09 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-messages/bp-messages-actions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-actions.php
r11578 r11688 132 132 * @since 2.4.0 This function was split from messages_screen_notices(). See #6505. 133 133 * 134 * @global int $notice_id135 *136 134 * @return boolean 137 135 */ 138 136 function bp_messages_action_edit_notice() { 139 global $notice_id;140 137 141 138 // Bail if not viewing a single notice URL. 142 if ( ! bp_is_messages_component() || ! bp_is_current_action( 'notices' ) || ! bp_action_variable( 1 ) ) { 143 return false; 144 } 145 146 // Get action variables. 147 $action = bp_action_variable( 0 ); // deactivate|activate|delete. 148 $notice_id = bp_action_variable( 1 ); // 1|2|3|etc... 139 if ( ! bp_is_messages_component() || ! bp_is_current_action( 'notices' ) ) { 140 return false; 141 } 142 143 // Get the notice ID (1|2|3). 144 $notice_id = bp_action_variable( 1 ); 149 145 150 146 // Bail if notice ID is not numeric. 151 if ( ! is_numeric( $notice_id ) ) { 152 return; 153 } 154 155 // Define local variables. 156 $redirect_to = ''; 157 $feedback = ''; 158 $success = false; 147 if ( empty( $notice_id ) || ! is_numeric( $notice_id ) ) { 148 return false; 149 } 150 151 // Bail if the current user doesn't have administrator privileges. 152 if ( ! bp_current_user_can( 'bp_moderate' ) ) { 153 return false; 154 } 155 156 // Get the action (deactivate|activate|delete). 157 $action = sanitize_key( bp_action_variable( 0 ) ); 158 159 // Check the nonce. 160 check_admin_referer( "messages_{$action}_notice" ); 159 161 160 162 // Get the notice from database. 161 $notice = new BP_Messages_Notice( $notice_id ); 163 $notice = new BP_Messages_Notice( $notice_id ); 164 $success = false; 165 $feedback = ''; 162 166 163 167 // Take action.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)