Changeset 13443 for trunk/src/bp-messages/actions/bulk-manage.php
- Timestamp:
- 03/31/2023 05:26:39 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-messages/actions/bulk-manage.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/actions/bulk-manage.php
r13096 r13443 22 22 } 23 23 24 $action = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : ''; 25 $nonce = ! empty( $_POST['messages_bulk_nonce'] ) ? $_POST['messages_bulk_nonce'] : ''; 26 $messages = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : ''; 27 $messages = wp_parse_id_list( $messages ); 24 $action = ! empty( $_POST['messages_bulk_action'] ) ? $_POST['messages_bulk_action'] : ''; 25 $nonce = ! empty( $_POST['messages_bulk_nonce'] ) ? $_POST['messages_bulk_nonce'] : ''; 26 $messages = ! empty( $_POST['message_ids'] ) ? $_POST['message_ids'] : ''; 27 $messages = wp_parse_id_list( $messages ); 28 $path_chunks = bp_members_get_path_chunks( array( bp_get_messages_slug(), bp_current_action() ) ); 29 $redirect = bp_displayed_user_url( $path_chunks ); 28 30 29 31 // Bail if no action or no IDs. 30 32 if ( ( ! in_array( $action, array( 'delete', 'read', 'unread' ), true ) ) || empty( $messages ) || empty( $nonce ) ) { 31 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');33 bp_core_redirect( $redirect ); 32 34 } 33 35 … … 41 43 if ( ! messages_check_thread_access( $message ) && ! bp_current_user_can( 'bp_moderate' ) ) { 42 44 bp_core_add_message( __( 'There was a problem managing your messages.', 'buddypress' ), 'error' ); 43 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');45 bp_core_redirect( $redirect ); 44 46 } 45 47 } … … 70 72 71 73 // Redirect back to message box. 72 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() . '/');74 bp_core_redirect( $redirect ); 73 75 } 74 76 add_action( 'bp_actions', 'bp_messages_action_bulk_manage' );
Note: See TracChangeset
for help on using the changeset viewer.