Fall back to ID id URL is empty

This commit is contained in:
Matthias Pfefferle 2023-07-10 10:28:45 +02:00
parent 9559a089be
commit a0a1e33dc8

View file

@ -33,6 +33,22 @@ class Follower extends Actor {
return get_post_meta( $this->_id, 'activitypub_errors' ); return get_post_meta( $this->_id, 'activitypub_errors' );
} }
/**
* Getter for URL attribute.
*
* Falls back to ID, if no URL is set. This is relevant for
* Plattforms like Lemmy, where the ID is the URL.
*
* @return string The URL.
*/
public function get_url() {
if ( $this->url ) {
return $this->url;
}
return $this->id;
}
/** /**
* Reset (delete) all errors. * Reset (delete) all errors.
* *