Changeset 761460
- Timestamp:
- 08/23/2013 08:31:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jetpack/trunk/modules/subscriptions.php
r754110 r761460 74 74 add_action( 'comment_form', array( $this, 'comment_subscribe_init' ) ); 75 75 76 // Catch comment posts and check for subscriptions. 77 add_action( 'comment_post', array( $this, 'comment_subscribe_submit' ), 50, 2 ); 76 // Catch comment posts or approvals; check for subscriptions. 77 add_action( 'comment_post', array( $this, 'comment_subscribe_submit' ), 50, 2 ); 78 add_action( 'comment_unapproved_to_approved', array( $this, 'comment_subscribe_on_transition' ), 50, 2 ); 78 79 } 79 80 … … 463 464 464 465 /** 465 * Jetpack_Subscriptions::comment_subscribe_init()466 467 468 469 470 if ( 'spam' === $approved ) {466 it() 467 * 468 * When a user checks the comment subscribe box and submits a comment, subscribe them to the comment thread. 469 */ 470 function comment_subscribe_submit( $comment_id, $approved ) { 471 if ( 471 472 return; 472 473 } … … 475 476 $this->set_cookies( isset( $_REQUEST['subscribe_comments'] ), isset( $_REQUEST['subscribe_blog'] ) ); 476 477 477 478 if ( !isset( $_REQUEST['subscribe_comments'] ) && !isset( $_REQUEST['subscribe_blog'] ) ) 478 479 return; 479 480 … … 488 489 489 490 Jetpack_Subscriptions::subscribe( $comment->comment_author_email, $post_ids ); 490 } 491 } 492 493 function comment_subscribe_on_transition( $comment_id, $comment ) { 494 if ( ! is_object( $comment ) ) 495 return; 496 497 Jetpack_Subscriptions::comment_subscribe_submit( (int) $comment_id, $comment->comment_approved ); 498 } 491 499 492 500 /**
Note: See TracChangeset
for help on using the changeset viewer.