Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetpack: Support comment management in Calypso #1104

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

* Added a filter to make custom comment types manageable in WP.com Calypso

## [4.6.0] - 2024-12-20

### Added
Expand Down
14 changes: 14 additions & 0 deletions integration/class-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Activitypub\Integration;

use Activitypub\Comment;

/**
* Jetpack integration class.
*/
Expand All @@ -17,6 +19,8 @@ class Jetpack {
*/
public static function init() {
\add_filter( 'jetpack_sync_post_meta_whitelist', array( self::class, 'add_sync_meta' ) );
\add_filter( 'jetpack_json_api_comment_types', array( self::class, 'add_comment_types' ) );
\add_filter( 'jetpack_api_include_comment_types_count', array( self::class, 'add_comment_types' ) );
}

/**
Expand All @@ -37,4 +41,14 @@ public static function add_sync_meta( $allow_list ) {
);
return \array_merge( $allow_list, $activitypub_meta_keys );
}

/**
* Add custom comment types to the list of comment types.
*
* @param array $comment_types Default comment types.
* @return array
*/
public static function add_comment_types( $comment_types ) {
return array_unique( \array_merge( $comment_types, Comment::get_comment_type_slugs() ) );
}
}
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ For reasons of data protection, it is not possible to see the followers of other

== Changelog ==

= Unreleased =

* Added: A filter to make custom comment types manageable in WP.com Calypso

= 4.6.0 =

* Added: A filter to allow modifying the ActivityPub preview template
Expand Down
Loading