Changeset 2680 for trunk/bp-activity.php
- Timestamp:
- 02/11/2010 04:19:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r2678 r2680 1 1 <?php 2 2 3 define ( 'BP_ACTIVITY_DB_VERSION', '20 40' );3 define ( 'BP_ACTIVITY_DB_VERSION', '2050' ); 4 4 5 5 /* Define the slug for the component */ … … 51 51 KEY item_id (item_id), 52 52 KEY component (component), 53 KEY type (type), 53 54 KEY mptt_left (mptt_left), 54 KEY mptt_right (mptt_right) 55 KEY mptt_right (mptt_right), 56 KEY hide_sitewide (hide_sitewide) 55 57 ) {$charset_collate};"; 56 58 … … 762 764 763 765 function bp_activity_delete_comment( $activity_id, $comment_id ) { 764 /* Recursively delete all children of this comment. */ 765 if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) { 766 foreach( (array)$children as $child ) 767 bp_activity_delete_comment( $activity_id, $child->id ); 768 } 769 bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', 'item_id' => $activity_id ) ); 766 /*** 767 * You may want to hook into this filter if you want to override this function and 768 * handle the deletion of child comments differently. Make sure you return false. 769 */ 770 if ( !apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) ) 771 return false; 772 773 /* Delete any children of this comment. */ 774 bp_activity_delete_children( $activity_id, $comment_id ); 770 775 771 776 /* Delete the actual comment */ … … 776 781 BP_Activity_Activity::rebuild_activity_comment_tree( $activity_id ); 777 782 783 do_action( 'bp_activity_delete_comment', $activity_id, $comment_id ); 784 778 785 return true; 779 786 } 787 function bp_activity_delete_children( $activity_id, $comment_id) { 788 /* Recursively delete all children of this comment. */ 789 if ( $children = BP_Activity_Activity::get_child_comments( $comment_id ) ) { 790 foreach( (array)$children as $child ) 791 bp_activity_delete_children( $activity_id, $child->id ); 792 } 793 bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', 'item_id' => $activity_id ) ); 794 } 780 795 781 796 function bp_activity_get_permalink( $activity_id, $activity_obj = false ) {
Note: See TracChangeset
for help on using the changeset viewer.