{"id":18389103,"date":"2025-03-29T06:41:50","date_gmt":"2025-03-29T06:41:50","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/filter-comment-syncing\/"},"modified":"2025-03-29T06:41:50","modified_gmt":"2025-03-29T06:41:50","slug":"filter-comment-syncing","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/filter-comment-syncing\/","title":{"rendered":"Filter comment syncing"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Currently this plugins sycs all new comments as posts into the main posts table. Like so<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">public function register_hooks() {<br \/>add_action( &#8216;init&#8217;, array( $this, &#8216;register_custom_post_type&#8217; ) );<br \/>add_action( &#8216;wp_insert_comment&#8217;, array( get_called_class(), &#8216;create_comment_post&#8217; ), 10, 2 );<br \/>add_action( &#8216;delete_comment&#8217;, array( $this, &#8216;delete_comment_post&#8217; ) );<br \/>add_action( &#8216;delete_post&#8217;, array( $this, &#8216;delete_post&#8217; ) );<br \/>add_action( &#8216;transition_comment_status&#8217;, array( $this, &#8216;update_comment_post_status&#8217; ), 10, 3 );<br \/>add_action( &#8216;edit_comment&#8217;, array( $this, &#8216;update_comment_post&#8217; ), 10, 2 );<br \/>add_filter( &#8216;mastodon_api_get_posts_query_args&#8217;, array( $this, &#8216;api_get_posts_query_args&#8217; ) );<br \/>add_filter( &#8216;mastodon_api_status&#8217;, array( $this, &#8216;api_status&#8217; ), 9, 3 );<br \/>add_filter( &#8216;mastodon_api_account&#8217;, array( $this, &#8216;api_account&#8217; ), 10, 4 );<br \/>add_filter( &#8216;mastodon_api_in_reply_to_id&#8217;, array( $this, &#8216;mastodon_api_in_reply_to_id&#8217; ), 15 );<br \/>add_filter( &#8216;mastodon_api_notification_type&#8217;, array( $this, &#8216;mastodon_api_notification_type&#8217; ), 10, 2 );<br \/>add_filter( &#8216;mastodon_api_get_notifications_query_args&#8217;, array( $this, &#8216;mastodon_api_notification_type&#8217; ), 10, 2 );<br \/>}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Unfortunately I have a custom comment type that I use for logging various events. It makes no sense for for that to be synced across and as such I was wondering if you could refactor you code to switch this syncing off via a filter?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is probably a reasonably comment use case going forward<\/p>\n","protected":false},"template":"","class_list":["post-18389103","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18389103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18389103\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18389103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}