This commit is contained in:
Alex Kirk 2022-12-12 16:39:55 +01:00
parent 8391e713c9
commit 3db9489b5c

View file

@ -35,10 +35,9 @@ class Mention {
* @return string the final string * @return string the final string
*/ */
public static function replace_with_links( $result ) { public static function replace_with_links( $result ) {
error_log($result[0]);
$metadata = \ActivityPub\get_remote_metadata_by_actor( $result[0] ); $metadata = \ActivityPub\get_remote_metadata_by_actor( $result[0] );
if ( ! is_wp_error( $metadata ) ) { if ( ! is_wp_error( $metadata ) ) {
$username = ltrim( $result[0], '@'); $username = ltrim( $result[0], '@' );
if ( ! empty( $metadata['name'] ) ) { if ( ! empty( $metadata['name'] ) ) {
$username = $metadata['name']; $username = $metadata['name'];
} }