Skip to content

atmosphere_should_sync_reply

github-actions[bot] edited this page Jun 1, 2026 · 9 revisions

Filters whether a reply should be synced as a WordPress comment.

Fires after the reply's target post and parent comment have been resolved, immediately before any work that depends on the reply being kept (author profile resolution, comment row insert, comment-meta writes). Return false to skip the insert.

Use case: consumers publishing multi-record threads from their own DID may want to skip the round-tripped self-replies that Reaction_Sync would otherwise ingest as comments. The filter is intentionally policy-free upstream so consumers can express whatever discriminator fits their publishing strategy.

Auto-generated Example

/**
 * Filters whether a reply should be synced as a WordPress comment.
 * 
 * Fires after the reply's target post and parent comment have been
 * resolved, immediately before any work that depends on the reply
 * being kept (author profile resolution, comment row insert,
 * comment-meta writes). Return false to skip the insert.
 * 
 * Use case: consumers publishing multi-record threads from their
 * own DID may want to skip the round-tripped self-replies that
 * `Reaction_Sync` would otherwise ingest as comments. The filter
 * is intentionally policy-free upstream so consumers can express
 * whatever discriminator fits their publishing strategy.
 *
 * @param bool  $should 
 * @param array $notification 
 * @param int   $post_id 
 * @param int   $comment_parent 
 * @return bool The filtered value.
 */
function my_atmosphere_should_sync_reply_callback( bool $should, array $notification, int $post_id, int $comment_parent ) {
    // Your code here.
    return $should;
}
add_filter( 'atmosphere_should_sync_reply', 'my_atmosphere_should_sync_reply_callback', 10, 4 );

Parameters

  • bool $should Whether to sync this reply. Default true.
  • array $notification Notification or synthesized own-record.
  • int $post_id Resolved local WP post the reply targets.
  • int $comment_parent Resolved local parent comment ID, 0 if top-level.

Files

\apply_filters(
			'atmosphere_should_sync_reply',
			true,
			$notification,
			$post_id,
			$comment_parent
		)

← All Hooks

Clone this wiki locally