Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Jan 29, 2025
1 parent f9b28b1 commit d58103a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/rest/class-outbox-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,14 @@ public function get_items( $request ) {
* @return array Response object on success, or WP_Error object on failure.
*/
public function prepare_item_for_response( $item, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
$type = \get_post_meta( $item->ID, '_activitypub_activity_type', true );
$type = \get_post_meta( $item->ID, '_activitypub_activity_type', true );

$activity = new Activity();
$activity->set_type( $type );
$activity->set_id( $item->guid );
// Pre-fill the Activity with data (for example cc and to).
$activity->set_object( \json_decode( $item->post_content, true ) );
$activity->set_actor( Actors::get_by_id( $item->post_author )->get_id() );
$activity->set_actor( Actors::get_by_various( $request->get_param( 'user_id' ) )->get_id() );

return $activity->to_array( false );
}
Expand Down

0 comments on commit d58103a

Please sign in to comment.