6
6
*/
7
7
8
8
use Activitypub \Blocks ;
9
+ use function Activitypub \is_activitypub_request ;
10
+
11
+ if ( is_activitypub_request () || is_feed () ) {
12
+ return ;
13
+ }
9
14
10
15
/* @var array $attributes Block attributes. */
11
16
$ attributes = wp_parse_args ( $ attributes );
68
73
<?php esc_html_e ( 'Copy and paste the Comment URL into the search field of your favorite fediverse app or server. ' , 'activitypub ' ); ?>
69
74
</div>
70
75
<div class="activitypub-dialog__button-group">
76
+ <label for="<?php echo esc_attr ( $ block_id . '-profile-handle ' ); ?> " class="screen-reader-text">
77
+ <?php esc_html_e ( 'Comment URL ' , 'activitypub ' ); ?>
78
+ </label>
71
79
<input
72
80
aria-readonly="true"
73
- id="profile-handle"
81
+ id="<?php echo esc_attr ( $ block_id . ' - profile-handle' ); ?> "
74
82
readonly
75
83
tabindex="-1"
76
84
type="text"
@@ -92,12 +100,15 @@ class="wp-element-button wp-block-button__link"
92
100
<?php esc_html_e ( 'Or, if you know your own profile, we can start things that way! ' , 'activitypub ' ); ?>
93
101
</div>
94
102
<div class="activitypub-dialog__button-group">
103
+ <label for="<?php echo esc_attr ( $ block_id . '-remote-profile ' ); ?> " class="screen-reader-text">
104
+ <?php esc_html_e ( 'Your Fediverse profile ' , 'activitypub ' ); ?>
105
+ </label>
95
106
<input
96
107
data-wp-bind--aria-invalid="context.isError"
97
108
data-wp-bind--value="context.remoteProfile"
98
109
data-wp-on--input="actions.updateRemoteProfile"
99
110
data-wp-on--keydown="actions.onInputKeydown"
100
- id="remote-profile"
111
+ id="<?php echo esc_attr ( $ block_id . ' - remote-profile' ); ?> "
101
112
placeholder="
<?php esc_attr_e (
'@[email protected] ' ,
'activitypub ' );
?> "
102
113
type="text"
103
114
/>
@@ -139,6 +150,7 @@ class="activitypub-dialog__error"
139
150
>
140
151
<div class="activitypub-remote-profile" hidden data-wp-bind--hidden="!context.hasRemoteUser">
141
152
<a
153
+ href=""
142
154
class="comment-reply-link activitypub-remote-profile__link"
143
155
data-wp-bind--href="state.remoteProfileUrl"
144
156
target="_blank"
@@ -172,7 +184,7 @@ class="comment-reply-link activitypub-remote-reply__link"
172
184
data-wp-bind--aria-expanded="context.modal.isOpen"
173
185
aria-label="<?php esc_attr_e ( 'Reply on the Fediverse ' , 'activitypub ' ); ?> "
174
186
aria-haspopup="dialog"
175
- aria-controls="modal-heading "
187
+ aria-controls="<?php echo esc_attr ( $ block_id . ' - modal-title ' ); ?> "
176
188
role="button"
177
189
tabindex="0"
178
190
hidden
@@ -183,6 +195,7 @@ class="comment-reply-link activitypub-remote-reply__link"
183
195
<?php
184
196
Blocks::render_modal (
185
197
array (
198
+ 'id ' => $ block_id . '-modal ' ,
186
199
'title ' => __ ( 'Remote Reply ' , 'activitypub ' ),
187
200
'content ' => $ modal_content ,
188
201
)
0 commit comments