Ticket #3460: cpt-added-to-bp-activity.diff
File cpt-added-to-bp-activity.diff, 2.9 KB (added by , 11 years ago) |
---|
-
bp-blogs/bp-blogs-functions.php
236 236 if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) ) 237 237 return false; 238 238 239 // Don't record this if it's not a post240 if ( !in_array( $post->post_type, apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) ) ) )239 //Block all WordPress default post types with the exception of 'post'. 240 if ( in_array( $post->post_type, apply_filters( 'bp_blogs_block_wp_default_post_types', array( 'page', 'revision', 'nav_menu_item', 'attachment' ) ) ) ) 241 241 return false; 242 242 243 243 $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) ); … … 246 246 if ( $is_blog_public || !is_multisite() ) { 247 247 248 248 // Record this in activity streams 249 $post_permalink 249 $post_permalink = get_permalink( $post_id ); 250 250 251 //Define a $post_type for our purposes 252 $post_type = get_post_type_object( $post->post_type ); 253 254 // Add a new string to $activity_action to grab the post_type label 251 255 if ( is_multisite() ) 252 $activity_action = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' ); 256 $activity_action = sprintf( __( '%1$s wrote a new %4$s %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>', '<span class="' . lcfirst($post_type->labels->singular_name) . '">' . $post_type->labels->singular_name . '</span>' ); 257 253 258 else 254 $activity_action = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>');259 $activity_action = sprintf( __( '%1$s wrote a new %2$s, %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<span class="' . lcfirst($post_type->labels->singular_name) . '">' . $post_type->labels->singular_name . '</span>', '<a href="' . $post_permalink . '">' . $post->post_title . '</a>'); 255 260 256 261 // Make sure there's not an existing entry for this post (prevent bumping) 257 262 if ( bp_is_active( 'activity' ) ) { … … 743 748 } 744 749 add_action( 'wpmu_delete_user', 'bp_blogs_remove_data' ); 745 750 add_action( 'delete_user', 'bp_blogs_remove_data' ); 746 add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' ); 751 add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' ); 752 No newline at end of file