|
8 | 8 | namespace Activitypub; |
9 | 9 |
|
10 | 10 | use Activitypub\Collection\Actors; |
| 11 | +use Activitypub\Collection\Posts; |
11 | 12 |
|
12 | 13 | /** |
13 | 14 | * ActivityPub Comment Class. |
@@ -703,7 +704,7 @@ public static function comment_query( $query ) { |
703 | 704 |
|
704 | 705 | // Do only exclude interactions of `ap_post` post type. |
705 | 706 | if ( \is_admin() ) { |
706 | | - $query->query_vars['post_type'] = array_diff( \get_post_types_by_support( 'comments' ), self::get_post_types_to_hide_comments_for() ); |
| 707 | + $query->query_vars['post_type'] = array_diff( \get_post_types_by_support( 'comments' ), self::hide_for() ); |
707 | 708 | return; |
708 | 709 | } |
709 | 710 |
|
@@ -767,7 +768,7 @@ public static function pre_comment_approved( $approved, $comment_data ) { |
767 | 768 | $post_id = $comment_data['comment_post_ID']; |
768 | 769 | $post = \get_post( $post_id ); |
769 | 770 |
|
770 | | - if ( $post && in_array( $post->post_type, self::get_post_types_to_hide_comments_for(), true ) ) { |
| 771 | + if ( $post && in_array( $post->post_type, self::hide_for(), true ) ) { |
771 | 772 | return 1; |
772 | 773 | } |
773 | 774 |
|
@@ -830,8 +831,8 @@ public static function is_comment_type_enabled( $comment_type ) { |
830 | 831 | * |
831 | 832 | * @return string[] Array of post type names to hide comments for. |
832 | 833 | */ |
833 | | - public static function get_post_types_to_hide_comments_for() { |
834 | | - $post_types = \get_post_types( array( 'public' => false ), 'names' ); |
| 834 | + public static function hide_for() { |
| 835 | + $post_types = array( Posts::POST_TYPE ); |
835 | 836 |
|
836 | 837 | /** |
837 | 838 | * Filters the list of post types to hide comments for. |
|
0 commit comments