post_type, $post_types, true ) ) { return; } Caching::get_instance()->delete_object_type_caches( 'ActivityPub' ); } /** * Reset cache by transition comment status. * * @param string $new_status The new comment status. * @param string $old_status The old comment status. * @param \WP_Comment $comment Comment object. */ public static function transition_comment_status( $new_status, $old_status, $comment ) { if ( 'approved' !== $new_status && 'approved' !== $old_status ) { return; } $comment_types = Comment::get_comment_type_slugs(); $comment_types[] = 'comment'; if ( ! \in_array( $comment->comment_type ?: 'comment', $comment_types, true ) ) { return; } Caching::get_instance()->delete_object_type_caches( 'ActivityPub' ); } /** * Test, whether the current endpoint is an ActivityPub endpoint. * * @param string $uri URI to test. * * @return bool Whether the current endpoint is an ActivityPub endpoint. */ private static function is_activitypub_endpoint( $uri ) { $search = '/' . ACTIVITYPUB_REST_NAMESPACE . '/'; return \str_contains( $uri, $search ) || \str_contains( $uri, 'rest_route=' . \rawurlencode( $search ) ); } }