Fall back to ID id URL is empty
This commit is contained in:
parent
9559a089be
commit
a0a1e33dc8
1 changed files with 16 additions and 0 deletions
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue