if ( in_array( 'status',
$fields, true
) ) { $data['status'
] =
$this->
prepare_status_response( $comment->comment_approved
);
} if ( in_array( 'type',
$fields, true
) ) { $data['type'
] =
get_comment_type( $comment->comment_ID
);
} if ( in_array( 'author_avatar_urls',
$fields, true
) ) { $data['author_avatar_urls'
] =
rest_get_avatar_urls( $comment );
} if ( in_array( 'meta',
$fields, true
) ) { $data['meta'
] =
$this->meta->
get_value( $comment->comment_ID,
$request );
} $context = !
empty( $request['context'
] ) ?
$request['context'
] : 'view';
$data =
$this->
add_additional_fields_to_object( $data,
$request );
$data =
$this->
filter_response_by_context( $data,
$context );
// Wrap the data in a response object.