If the Blog is in "single user" mode, return "Person" insted of "Group".

This commit is contained in:
Matthias Pfefferle 2023-07-11 09:28:10 +02:00
parent befd0d4f1e
commit 57bc4214b7

View file

@ -5,6 +5,7 @@ use WP_Query;
use Activitypub\Signature;
use Activitypub\Collection\Users;
use function Activitypub\is_single_user;
use function Activitypub\is_user_disabled;
class Blog_User extends User {
@ -206,4 +207,19 @@ class Blog_User extends User {
public function get_canonical_url() {
return \home_url();
}
/**
* Get the type of the object.
*
* If the Blog is in "single user" mode, return "Person" insted of "Group".
*
* @return string The type of the object.
*/
public function get_type() {
if ( is_single_user() ) {
return 'Person';
} else {
return $this->type;
}
}
}