Changeset 606991
- Timestamp:
- 10/02/2012 02:24:11 PM (12 years ago)
- Location:
- jetpack/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
jetpack/trunk/jetpack.php
r605350 r606991 204 204 add_action( 'customize_controls_enqueue_scripts', array( $this, 'devicepx' ) ); 205 205 add_action( 'admin_enqueue_scripts', array( $this, 'devicepx' ) ); 206 } 207 206 207 //Mobile comment push notifications 208 add_action( 'wp_insert_comment', array( $this, 'save_comment' ) , 10, 2 ); 209 } 210 211 /** 212 * Synch comment with the .COM backend. 213 */ 214 function save_comment( $id, $comment ) { 215 216 $post = $this->get_post( $comment->comment_post_ID ); 217 218 if ( $this->is_post_public( $post ) === false ) 219 return; 220 221 /*if ( ! Jetpack_Subscriptions::post_is_public( $comment->comment_post_ID ) ) { 222 return; 223 }*/ 224 225 if ( 'spam' === $comment->comment_approved ) { 226 return; 227 } 228 229 $this->sync->comment( $id ); 230 } 231 208 232 /** 209 233 * Device Pixels support -
jetpack/trunk/modules/subscriptions.php
r603548 r606991 56 56 57 57 // Handle Comments 58 add_action( 'wp_insert_comment', array( $this, 'save_comment' ), 10, 2 );59 58 add_action( 'transition_comment_status', array( $this, 'transition_comment_status' ), 10, 3 ); 60 59 add_action( 'trashed_comment', array( $this, 'delete_comment' ) ); … … 121 120 if ( 'post' == $the_post->post_type || 'page' == $the_post->post_type ) 122 121 $this->jetpack->sync->delete_post( $id ); 123 }124 125 function save_comment( $id, $comment ) {126 if ( !$this->post_is_public( $comment->comment_post_ID ) ) {127 return;128 }129 130 if ( 'spam' === $comment->comment_approved ) {131 return;132 }133 134 $this->jetpack->sync->comment( $id );135 122 } 136 123
Note: See TracChangeset
for help on using the changeset viewer.