What
Interact with remote posts via ActivityPub API:
Related #3466
Why
In order to participate with the broader Fediverse, outside of our own posts
How
There seem to be 2 main blockers for interacting with remote posts.
- The $result of
\apply_filters( 'activitypub_outbox_' will be a WP_Comment with a comment_post_ID of 0
|
$parent_comment_id = 0; |
|
|
|
if ( ! empty( $activity['object']['inReplyTo'] ) ) { |
|
// Regular reply. |
|
$target_url = object_to_uri( $activity['object']['inReplyTo'] ); |
|
$parent_comment_id = url_to_commentid( $target_url ); |
$target_url is not guaranteed to be another comment, so additional checks should search for an ap_post. In the case of an activity fetched via proxy, an ap_post will not be found since it exists only as a transient, so a pre comment hook would be needed to save it as an ap_post.
Outbox::get_by_object_id() will return null for a WP_Comment
|
public static function get_by_object_id( $object_id, $activity_type ) { |
|
$outbox_items = \get_posts( |
What
Interact with remote posts via ActivityPub API:
AnnounceRelated #3466
Why
In order to participate with the broader Fediverse, outside of our own posts
How
There seem to be 2 main blockers for interacting with remote posts.
\apply_filters( 'activitypub_outbox_'will be a WP_Comment with acomment_post_IDof 0wordpress-activitypub/includes/collection/class-interactions.php
Lines 48 to 53 in 45f3472
$target_urlis not guaranteed to be another comment, so additional checks should search for anap_post. In the case of an activity fetched via proxy, anap_postwill not be found since it exists only as a transient, so a pre comment hook would be needed to save it as anap_post.Outbox::get_by_object_id()will returnnullfor aWP_Commentwordpress-activitypub/includes/collection/class-outbox.php
Lines 283 to 284 in 45f3472