|
@@ 33-38 (lines=6) @@
|
| 30 |
|
// even though it's messy, we implement these hooks because |
| 31 |
|
// the edit_comment hook doesn't include the data |
| 32 |
|
// so this saves us a DB read for every comment event |
| 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_action( $comment_action_name, $callable, 10, 2 ); |
| 37 |
|
} |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
// listen for meta changes |
| 41 |
|
$this->init_listeners_for_meta_type( 'comment', $callable ); |
|
@@ 81-86 (lines=6) @@
|
| 78 |
|
public function init_before_send() { |
| 79 |
|
add_filter( 'jetpack_sync_before_send_wp_insert_comment', array( $this, 'expand_wp_insert_comment' ) ); |
| 80 |
|
|
| 81 |
|
foreach ( array( '', 'trackback', 'pingback' ) as $comment_type ) { |
| 82 |
|
foreach ( array( 'unapproved', 'approved' ) as $comment_status ) { |
| 83 |
|
$comment_action_name = "comment_{$comment_status}_{$comment_type}"; |
| 84 |
|
add_filter( 'jetpack_sync_before_send_' . $comment_action_name, array( |
| 85 |
|
$this, |
| 86 |
|
'expand_wp_insert_comment', |
| 87 |
|
) ); |
| 88 |
|
} |
| 89 |
|
} |