Revert User::get_webfinger_identifier (#398)

we already have `User::get_resource` to do the same
This commit is contained in:
Matt Wiebe 2023-08-16 07:52:26 -05:00 committed by GitHub
parent d6ff82b337
commit 78870cd206
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,15 +107,6 @@ class User extends Actor {
return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_username() );
}
/**
* Returns a user@domain type of identifier for the user.
*
* @return string The Webfinger-Identifier.
*/
public function get_webfinger_identifier() {
return sprintf( '%s@%s', $this->get_preferred_username(), wp_parse_url( home_url(), PHP_URL_HOST ) );
}
public function get_preferred_username() {
return \esc_attr( \get_the_author_meta( 'login', $this->_id ) );
}
@ -298,6 +289,11 @@ class User extends Actor {
return $array;
}
/**
* Returns a user@domain type of identifier for the user.
*
* @return string The Webfinger-Identifier.
*/
public function get_resource() {
return $this->get_preferred_username() . '@' . \wp_parse_url( \home_url(), \PHP_URL_HOST );
}