Changeset 762486
- Timestamp:
- 08/26/2013 02:57:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jetpack/trunk/modules/subscriptions.php
r761460 r762486 74 74 add_action( 'comment_form', array( $this, 'comment_subscribe_init' ) ); 75 75 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 ); 76 // Catch comment posts and check for subscriptions. 77 add_action( 'comment_post', array( $this, 'comment_subscribe_submit' ), 50, 2 ); 79 78 } 80 79 … … 464 463 465 464 /** 466 * Jetpack_Subscriptions::comment_subscribe_submit()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 ( 1 !== $approved || 'approve' !== $approved ) { // if the comment is not approved, spam, or held, do not sync it465 it() 466 * 467 * When a user checks the comment subscribe box and submits a comment, subscribe them to the comment thread. 468 */ 469 function comment_subscribe_submit( $comment_id, $approved ) { 470 if ( 472 471 return; 473 472 } … … 476 475 $this->set_cookies( isset( $_REQUEST['subscribe_comments'] ), isset( $_REQUEST['subscribe_blog'] ) ); 477 476 478 if ( !isset( $_REQUEST['subscribe_comments'] ) && !isset( $_REQUEST['subscribe_blog'] ) )477 if ( !isset( $_REQUEST['subscribe_comments'] ) && !isset( $_REQUEST['subscribe_blog'] ) ) 479 478 return; 480 479 … … 489 488 490 489 Jetpack_Subscriptions::subscribe( $comment->comment_author_email, $post_ids ); 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 } 490 } 499 491 500 492 /**
Note: See TracChangeset
for help on using the changeset viewer.