small changes
This commit is contained in:
parent
7d525a8efe
commit
e9ea9db6a3
1 changed files with 5 additions and 4 deletions
|
@ -2,7 +2,9 @@
|
||||||
namespace Activitypub;
|
namespace Activitypub;
|
||||||
|
|
||||||
use WP_Error;
|
use WP_Error;
|
||||||
|
use WP_Comment_Query;
|
||||||
use Activitypub\Http;
|
use Activitypub\Http;
|
||||||
|
use Activitypub\Webfinger;
|
||||||
use Activitypub\Activity\Activity;
|
use Activitypub\Activity\Activity;
|
||||||
use Activitypub\Collection\Followers;
|
use Activitypub\Collection\Followers;
|
||||||
|
|
||||||
|
@ -174,7 +176,7 @@ function url_to_authorid( $url ) {
|
||||||
* @return WP_Comment, or undef if no comment could be found.
|
* @return WP_Comment, or undef if no comment could be found.
|
||||||
*/
|
*/
|
||||||
function object_id_to_comment( $id ) {
|
function object_id_to_comment( $id ) {
|
||||||
$comment_query = new \WP_Comment_Query(
|
$comment_query = new WP_Comment_Query(
|
||||||
array(
|
array(
|
||||||
'meta_key' => 'source_id',
|
'meta_key' => 'source_id',
|
||||||
'meta_value' => $id,
|
'meta_value' => $id,
|
||||||
|
@ -184,7 +186,6 @@ function object_id_to_comment( $id ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( count( $comment_query->comments ) > 1 ) {
|
if ( count( $comment_query->comments ) > 1 ) {
|
||||||
\error_log( "More than one comment under {$id}" );
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return $comment_query->comments[0];
|
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 );
|
$comments = $comments_query->query( $comment_args );
|
||||||
$found_comment_ids = array();
|
$found_comment_ids = array();
|
||||||
if ( $comments ) {
|
if ( $comments ) {
|
||||||
|
|
Loading…
Reference in a new issue