From 626616a747371b2590182be6d4b81a6af9de9776 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 14 Jul 2023 11:29:03 +0200 Subject: [PATCH] always use host as default username --- includes/model/class-blog-user.php | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/includes/model/class-blog-user.php b/includes/model/class-blog-user.php index feee0976..32d167ab 100644 --- a/includes/model/class-blog-user.php +++ b/includes/model/class-blog-user.php @@ -79,38 +79,13 @@ class Blog_User extends User { // check if domain host has a subdomain $host = \wp_parse_url( \get_home_url(), \PHP_URL_HOST ); $host = \preg_replace( '/^www\./i', '', $host ); - $host_parts = \explode( '.', $host ); - - if ( \count( $host_parts ) <= 2 && strlen( $host ) <= 15 ) { - return $host; - } - - // check blog title - $blog_title = \get_bloginfo( 'name' ); - $blog_title = \sanitize_title( $blog_title ); - - if ( strlen( $blog_title ) <= 15 ) { - return $blog_title; - } - - $default_identifier = array( - 'feed', - 'all', - 'everyone', - 'authors', - 'follow', - 'posts', - ); - - // get random item of $default_identifier - $default = $default_identifier[ \array_rand( $default_identifier ) ]; /** * Filter the default blog username. * - * @param string $default The default username. + * @param string $host The default username. */ - return apply_filters( 'activitypub_default_blog_username', $default ); + return apply_filters( 'activitypub_default_blog_username', $host ); } /**