From e9ea9db6a3e6dc03a8e2199836663e443c2a29c1 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 7 Nov 2023 09:59:02 +0100 Subject: [PATCH] small changes --- includes/functions.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 3605925..d6889d2 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -2,7 +2,9 @@ namespace Activitypub; use WP_Error; +use WP_Comment_Query; use Activitypub\Http; +use Activitypub\Webfinger; use Activitypub\Activity\Activity; use Activitypub\Collection\Followers; @@ -174,9 +176,9 @@ function url_to_authorid( $url ) { * @return WP_Comment, or undef if no comment could be found. */ function object_id_to_comment( $id ) { - $comment_query = new \WP_Comment_Query( + $comment_query = new WP_Comment_Query( array( - 'meta_key' => 'source_id', + 'meta_key' => 'source_id', 'meta_value' => $id, ) ); @@ -184,7 +186,6 @@ function object_id_to_comment( $id ) { return; } if ( count( $comment_query->comments ) > 1 ) { - \error_log( "More than one comment under {$id}" ); return; } return $comment_query->comments[0]; @@ -278,7 +279,7 @@ function url_to_commentid( $in_replyto_url ) { ), ), ); - $comments_query = new \WP_Comment_Query(); + $comments_query = new WP_Comment_Query(); $comments = $comments_query->query( $comment_args ); $found_comment_ids = array(); if ( $comments ) {