- Timestamp:
- 09/24/2021 01:54:39 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/activity/ajax.php
r12972 r13114 4 4 * 5 5 * @since 3.0.0 6 * @version 8.1.06 * @version 10.0.0 7 7 */ 8 8 … … 233 233 // Deleting an activity comment. 234 234 if ( ! empty( $_POST['is_comment'] ) ) { 235 // Get replies before they are deleted. 236 $replies = (array) BP_Activity_Activity::get_child_comments( $activity->id ); 237 $reply_ids = wp_list_pluck( $replies, 'id' ); 238 235 239 if ( ! bp_activity_delete_comment( $activity->item_id, $activity->id ) ) { 236 240 wp_send_json_error( $response ); 241 242 // The comment and its replies has been deleted successfully. 243 } else { 244 $response = array( 245 'deleted' => array_merge( 246 array( $activity->id ), 247 $reply_ids 248 ), 249 ); 237 250 } 238 251 … … 241 254 if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) { 242 255 wp_send_json_error( $response ); 256 257 // The activity has been deleted successfully. 258 } else { 259 $response = array( 260 'deleted' => array( $activity->id ), 261 ); 243 262 } 244 263 } … … 246 265 /** This action is documented in bp-activity/bp-activity-actions.php */ 247 266 do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); 248 249 // The activity has been deleted successfully250 $response = array( 'deleted' => $activity->id );251 267 252 268 // If on a single activity redirect to user's home.
Note: See TracChangeset
for help on using the changeset viewer.