Skip to content

Commit 7913faa

Browse files
authored
Add @ prefix to Follow-Block (#694)
1 parent 1d6c8ea commit 7913faa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

includes/class-blocks.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ public static function render_follow_me_block( $attrs ) {
7878
array( 'icon', 'name', 'webfinger' )
7979
);
8080
}
81+
82+
// add `@` prefix if it's missing
83+
if ( '@' !== substr( $attrs['profileData']['webfinger'], 0, 1 ) ) {
84+
$attrs['profileData']['webfinger'] = '@' . $attrs['profileData']['webfinger'];
85+
}
86+
8187
$wrapper_attributes = get_block_wrapper_attributes(
8288
array(
8389
'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ),

0 commit comments

Comments
 (0)