Changeset 1979
- Timestamp:
- 09/28/2009 08:48:50 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r1905 r1979 475 475 add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 ); 476 476 477 function bp_blogs_approve_comment( $comment_id, $comment ) {477 function bp_blogs_approve_comment( $comment_id, $comment_status ) { 478 478 global $bp, $wpdb; 479 480 if ( 'approve' != $comment_status ) 481 return false; 479 482 480 483 $recorded_comment = bp_blogs_record_comment( $comment_id, true ); … … 484 487 bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'secondary_item_id' => $recorded_comment->blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment' ) ); 485 488 486 $comment_link = bp_post_get_permalink( $comment->post, $ comment->blog_id );487 $ content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $recorded_comment->user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' );488 $ content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>';489 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); 490 $activity_content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $recorded_comment->user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ); 491 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 489 492 490 493 /* Record this in activity streams */ … … 499 502 ) ); 500 503 } 501 add_action( ' comment_approved_', 'bp_blogs_approve_comment', 10, 2 );502 503 function bp_blogs_unapprove_comment( $comment_id, $ status = false) {504 if ( 'spam' == $ status || !$status )504 add_action( 'wp_set_comment_status', 'bp_blogs_approve_comment', 10, 2 ); 505 506 function bp_blogs_unapprove_comment( $comment_id, $comment_status ) { 507 if ( 'spam' == $comment_status || 'hold' == $comment_status || 'delete' == $comment_status ) 505 508 bp_blogs_remove_comment( $comment_id ); 506 509 } 507 add_action( 'comment_unapproved_', 'bp_blogs_unapprove_comment' );508 510 add_action( 'wp_set_comment_status', 'bp_blogs_unapprove_comment', 10, 2 ); 509 511
Note: See TracChangeset
for help on using the changeset viewer.