7777
7878if ( empty ( $ content ) ) {
7979 $ button_text = $ attributes ['buttonText ' ] ?? __ ( 'Follow ' , 'activitypub ' );
80- $ content = '<div class="wp-block-button"><button class="wp-block-button__link wp-element-button "> ' . esc_html ( $ button_text ) . '</button ></div> ' ;
80+ $ content = '<div class="wp-block-button"><a class="wp-element-button wp-block-button__link "> ' . esc_html ( $ button_text ) . '</a ></div> ' ;
8181} else {
8282 $ content = implode ( PHP_EOL , wp_list_pluck ( $ block ->parsed_block ['innerBlocks ' ], 'innerHTML ' ) );
8383}
8787 array ( 'class_name ' => 'wp-element-button ' ),
8888 array (
8989 'data-wp-on--click ' => 'actions.toggleModal ' ,
90+ 'data-wp-on-async--keydown ' => 'actions.onKeydown ' ,
9091 'data-wp-bind--aria-expanded ' => 'context.modal.isOpen ' ,
9192 'aria-label ' => __ ( 'Follow me on the Fediverse ' , 'activitypub ' ),
9293 'aria-haspopup ' => 'dialog ' ,
9394 'aria-controls ' => 'modal-heading ' ,
95+ 'role ' => 'button ' ,
96+ 'tabindex ' => '0 ' ,
9497 )
9598);
9699
97100$ header_image = $ actor ->get_image ();
98101$ has_header = ! empty ( $ header_image ['url ' ] ) && str_contains ( $ attributes ['className ' ] ?? '' , 'is-style-profile ' );
99102
100103$ stats = array (
101- 'posts ' => count_user_posts ( $ user_id , 'post ' , true ),
104+ 'posts ' => $ user_id ? count_user_posts ( $ user_id , 'post ' , true ) : ( int ) wp_count_posts ()-> publish ,
102105 'followers ' => Followers::count_followers ( $ user_id ),
103106);
104107
@@ -122,7 +125,8 @@ class="activitypub-profile__avatar u-photo"
122125 <div class="activitypub-profile__content">
123126 <div class="activitypub-profile__info">
124127 <div class="activitypub-profile__name p-name"><?php echo esc_html ( $ actor ->get_name () ); ?> </div>
125- <div class="activitypub-profile__handle p-nickname p-x-webfinger"><?php echo esc_html ( '@ ' . $ actor ->get_webfinger () ); ?> </div>
128+ <?php /** Using `data-wp-text` to avoid @see enrich_content_data() turning it into a mention. */ ?>
129+ <div class="activitypub-profile__handle p-nickname p-x-webfinger" data-wp-text="context.webfinger"></div>
126130 </div>
127131
128132 <?php echo $ content ; // phpcs:ignore WordPress.Security.EscapeOutput ?>
0 commit comments