|
@@ 18-23 (lines=6) @@
|
| 15 |
|
// even though it's messy, we implement these hooks because |
| 16 |
|
// the edit_comment hook doesn't include the data |
| 17 |
|
// so this saves us a DB read for every comment event |
| 18 |
|
foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) { |
| 19 |
|
foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { |
| 20 |
|
$comment_action_name = "comment_{$comment_status}_{$comment_type}"; |
| 21 |
|
add_action( $comment_action_name, $callable, 10, 2 ); |
| 22 |
|
} |
| 23 |
|
} |
| 24 |
|
} |
| 25 |
|
|
| 26 |
|
public function init_full_sync_listeners( $callable ) { |
|
@@ 33-38 (lines=6) @@
|
| 30 |
|
public function init_before_send() { |
| 31 |
|
add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) ); |
| 32 |
|
|
| 33 |
|
foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) { |
| 34 |
|
foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { |
| 35 |
|
$comment_action_name = "comment_{$comment_status}_{$comment_type}"; |
| 36 |
|
add_filter( 'jetpack_sync_before_send_' . $comment_action_name, array( |
| 37 |
|
$this, |
| 38 |
|
'expand_wp_insert_comment', |
| 39 |
|
) ); |
| 40 |
|
} |
| 41 |
|
} |