Changeset 10631
- Timestamp:
- 03/04/2016 06:37:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/src/bp-blogs/bp-blogs-functions.php
r10544 r10631 280 280 $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); 281 281 282 // Only record this activity if the blog is public.283 if ( !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) {282 // Only record this activity if the activity component is active and the blog is public. 283 if ( bp_is_active( 'activity' ) && !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) { 284 284 285 285 // Record this in activity streams. … … 816 816 BP_Blogs_Blog::delete_blog_for_all( $blog_id ); 817 817 818 // Delete activity stream item. 819 bp_blogs_delete_activity( array( 820 'item_id' => $blog_id, 821 'component' => buddypress()->blogs->id, 822 'type' => 'new_blog' 823 ) ); 818 /** 819 * Delete activity stream item only if the Activity component is active 820 * 821 * @see https://buddypress.trac.wordpress.org/ticket/6937 822 */ 823 if ( bp_is_active( 'activity' ) ) { 824 bp_blogs_delete_activity( array( 825 'item_id' => $blog_id, 826 'component' => buddypress()->blogs->id, 827 'type' => 'new_blog' 828 ) ); 829 } 824 830 825 831 /** … … 858 864 BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id ); 859 865 860 // Delete activity stream item. 861 bp_blogs_delete_activity( array( 862 'item_id' => $blog_id, 863 'component' => buddypress()->blogs->id, 864 'type' => 'new_blog' 865 ) ); 866 /** 867 * Delete activity stream item only if the Activity component is active 868 * 869 * @see https://buddypress.trac.wordpress.org/ticket/6937 870 */ 871 if ( bp_is_active( 'activity' ) ) { 872 bp_blogs_delete_activity( array( 873 'item_id' => $blog_id, 874 'component' => buddypress()->blogs->id, 875 'type' => 'new_blog' 876 ) ); 877 } 866 878 867 879 /** … … 911 923 do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id ); 912 924 913 // Delete activity stream item. 914 bp_blogs_delete_activity( array( 915 'item_id' => $blog_id, 916 'secondary_item_id' => $post_id, 917 'component' => buddypress()->blogs->id, 918 'type' => 'new_blog_post' 919 ) ); 925 /** 926 * Delete activity stream item only if the Activity component is active 927 * 928 * @see https://buddypress.trac.wordpress.org/ticket/6937 929 */ 930 if ( bp_is_active( 'activity' ) ) { 931 bp_blogs_delete_activity( array( 932 'item_id' => $blog_id, 933 'secondary_item_id' => $post_id, 934 'component' => buddypress()->blogs->id, 935 'type' => 'new_blog_post' 936 ) ); 937 } 920 938 921 939 /** … … 1109 1127 BP_Blogs_Blog::delete_blog_for_all( $blog_id ); 1110 1128 1111 // Delete activity stream item. 1112 bp_blogs_delete_activity( array( 1113 'item_id' => $blog_id, 1114 'component' => buddypress()->blogs->id, 1115 'type' => false 1116 ) ); 1129 /** 1130 * Delete activity stream item only if the Activity component is active 1131 * 1132 * @see https://buddypress.trac.wordpress.org/ticket/6937 1133 */ 1134 if ( bp_is_active( 'activity' ) ) { 1135 bp_blogs_delete_activity( array( 1136 'item_id' => $blog_id, 1137 'component' => buddypress()->blogs->id, 1138 'type' => false 1139 ) ); 1140 } 1117 1141 1118 1142 /**
Note: See TracChangeset
for help on using the changeset viewer.