check if user is available

This commit is contained in:
Matthias Pfefferle 2023-11-21 14:57:44 +01:00
parent d226564325
commit 60148a3b65

View file

@ -30,6 +30,10 @@ class Webfinger {
public static function add_user_discovery( $array, $resource, $user ) { public static function add_user_discovery( $array, $resource, $user ) {
$user = User_Collection::get_by_id( $user->ID ); $user = User_Collection::get_by_id( $user->ID );
if ( ! $user || is_wp_error( $user ) ) {
return $array;
}
$array['links'][] = array( $array['links'][] = array(
'rel' => 'self', 'rel' => 'self',
'type' => 'application/activity+json', 'type' => 'application/activity+json',