From 57bc4214b70912b61bf9dcaee4ce8a74d5f40d1e Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 11 Jul 2023 09:28:10 +0200 Subject: [PATCH] If the Blog is in "single user" mode, return "Person" insted of "Group". --- includes/model/class-blog-user.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/includes/model/class-blog-user.php b/includes/model/class-blog-user.php index 4cf41f9..a0efcb6 100644 --- a/includes/model/class-blog-user.php +++ b/includes/model/class-blog-user.php @@ -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; + } + } }