Skip to content

Commit d1565c8

Browse files
authored
Merge branch 'trunk' into add/emoji-support
2 parents a74e8fc + 3bd67d7 commit d1565c8

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
* Support for custom emoji in interaction contents and actor names
13+
* Added a filter to make custom comment types manageable in WP.com Calypso
1314

1415
### Fixed
1516

integration/class-jetpack.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Activitypub\Integration;
99

10+
use Activitypub\Comment;
11+
1012
/**
1113
* Jetpack integration class.
1214
*/
@@ -17,6 +19,8 @@ class Jetpack {
1719
*/
1820
public static function init() {
1921
\add_filter( 'jetpack_sync_post_meta_whitelist', array( self::class, 'add_sync_meta' ) );
22+
\add_filter( 'jetpack_json_api_comment_types', array( self::class, 'add_comment_types' ) );
23+
\add_filter( 'jetpack_api_include_comment_types_count', array( self::class, 'add_comment_types' ) );
2024
}
2125

2226
/**
@@ -37,4 +41,14 @@ public static function add_sync_meta( $allow_list ) {
3741
);
3842
return \array_merge( $allow_list, $activitypub_meta_keys );
3943
}
44+
45+
/**
46+
* Add custom comment types to the list of comment types.
47+
*
48+
* @param array $comment_types Default comment types.
49+
* @return array
50+
*/
51+
public static function add_comment_types( $comment_types ) {
52+
return array_unique( \array_merge( $comment_types, Comment::get_comment_type_slugs() ) );
53+
}
4054
}

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ For reasons of data protection, it is not possible to see the followers of other
135135
= Unreleased =
136136

137137
* Added: Support for custom emoji in interaction contents and actor names
138+
* Added: A filter to make custom comment types manageable in WP.com Calypso
138139
* Fixed: Undefined array key warnings in various places
139140

140141
= 4.6.0 =

0 commit comments

Comments
 (0)