diff --git a/includes/functions.php b/includes/functions.php index ecb8765..f9d602f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -279,6 +279,16 @@ function is_activitypub_request() { return false; } + // Check if the current post type supports ActivityPub. + if ( \is_singular() ) { + $queried_object = \get_queried_object(); + $post_type = \get_post_type( $queried_object ); + + if ( ! \post_type_supports( $post_type, 'activitypub' ) ) { + return false; + } + } + // One can trigger an ActivityPub request by adding ?activitypub to the URL. // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration global $wp_query;