Changeset 10971 for trunk/src/bp-blogs/bp-blogs-activity.php
- Timestamp:
- 07/30/2016 11:40:55 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-activity.php
r10947 r10971 640 640 * @param int $blog_id Site ID. 641 641 */ 642 function bp_blogs_delete_new_blog_activity_for_site( $blog_id ) {643 bp_blogs_delete_activity(array(642 function bp_blogs_delete_new_blog_activity_for_site( $blog_id, $user_id = 0 ) { 643 $args = array( 644 644 'item_id' => $blog_id, 645 645 'component' => buddypress()->blogs->id, 646 646 'type' => 'new_blog' 647 ) ); 648 } 649 add_action( 'bp_blogs_remove_blog', 'bp_blogs_delete_new_blog_activity_for_site' ); 650 add_action( 'bp_blogs_remove_blog_for_user', 'bp_blogs_delete_new_blog_activity_for_site' ); 647 ); 648 649 /** 650 * In the case a user is removed, make sure he is the author of the 'new_blog' activity 651 * when trying to delete it. 652 */ 653 if ( ! empty( $user_id ) ) { 654 $args['user_id'] = $user_id; 655 } 656 657 bp_blogs_delete_activity( $args ); 658 } 659 add_action( 'bp_blogs_remove_blog', 'bp_blogs_delete_new_blog_activity_for_site', 10, 1 ); 660 add_action( 'bp_blogs_remove_blog_for_user', 'bp_blogs_delete_new_blog_activity_for_site', 10, 2 ); 651 661 652 662 /**
Note: See TracChangeset
for help on using the changeset viewer.