diff --git a/.github/changelog/2083-from-description b/.github/changelog/2083-from-description new file mode 100644 index 000000000..5485f916c --- /dev/null +++ b/.github/changelog/2083-from-description @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix duplicate HTML IDs and missing form labels in modal blocks diff --git a/build/follow-me/render.php b/build/follow-me/render.php index df7f3ec4c..cd8a08a2e 100644 --- a/build/follow-me/render.php +++ b/build/follow-me/render.php @@ -8,6 +8,7 @@ use Activitypub\Blocks; use Activitypub\Collection\Actors; use Activitypub\Collection\Followers; + use function Activitypub\is_activitypub_request; if ( is_activitypub_request() || is_feed() ) { @@ -96,7 +97,7 @@ 'data-wp-bind--aria-expanded' => 'context.modal.isOpen', 'aria-label' => __( 'Follow me on the Fediverse', 'activitypub' ), 'aria-haspopup' => 'dialog', - 'aria-controls' => 'modal-heading', + 'aria-controls' => $block_id . '-modal-title', 'role' => 'button', 'tabindex' => '0', ) @@ -118,9 +119,12 @@
+
+ @@ -235,6 +242,7 @@ class="activitypub-profile__avatar u-photo" // Render the modal using the Blocks class. Blocks::render_modal( array( + 'id' => $block_id . '-modal', 'content' => $modal_content, /* translators: %s: Profile name. */ 'title' => sprintf( esc_html__( 'Follow %s', 'activitypub' ), esc_html( $actor->get_name() ) ), diff --git a/build/remote-reply/render.php b/build/remote-reply/render.php index 2e7026c90..eb7ff7d71 100644 --- a/build/remote-reply/render.php +++ b/build/remote-reply/render.php @@ -6,6 +6,11 @@ */ use Activitypub\Blocks; +use function Activitypub\is_activitypub_request; + +if ( is_activitypub_request() || is_feed() ) { + return; +} /* @var array $attributes Block attributes. */ $attributes = wp_parse_args( $attributes ); @@ -68,9 +73,12 @@
+
+ @@ -139,6 +150,7 @@ class="activitypub-dialog__error" >