updated plugin ActivityPub
version 2.0.1
This commit is contained in:
@ -14,7 +14,8 @@ class Mention {
|
||||
* Initialize the class, registering WordPress hooks
|
||||
*/
|
||||
public static function init() {
|
||||
\add_filter( 'the_content', array( self::class, 'the_content' ), 99, 2 );
|
||||
\add_filter( 'the_content', array( self::class, 'the_content' ), 99, 1 );
|
||||
\add_filter( 'comment_text', array( self::class, 'the_content' ), 10, 1 );
|
||||
\add_filter( 'activitypub_extract_mentions', array( self::class, 'extract_mentions' ), 99, 2 );
|
||||
}
|
||||
|
||||
@ -100,7 +101,14 @@ class Mention {
|
||||
if ( ! empty( $metadata['preferredUsername'] ) ) {
|
||||
$username = $metadata['preferredUsername'];
|
||||
}
|
||||
return \sprintf( '<a rel="mention" class="u-url mention" href="%s">@<span>%s</span></a>', esc_url( $metadata['url'] ), esc_html( $username ) );
|
||||
|
||||
$url = isset( $metadata['url'] ) ? $metadata['url'] : $metadata['url'];
|
||||
|
||||
if ( \is_array( $url ) ) {
|
||||
$url = $url[0];
|
||||
}
|
||||
|
||||
return \sprintf( '<a rel="mention" class="u-url mention" href="%s">@<span>%s</span></a>', esc_url( $url ), esc_html( $username ) );
|
||||
}
|
||||
|
||||
return $result[0];
|
||||
|
Reference in New Issue
Block a user