Skip to content

65766 - Added aria-describedby for search engine visibility setting - #12794

Closed
sawfly wants to merge 5 commits into
WordPress:trunkfrom
sawfly:65766-Add-aria-described-for-search-engine-setting
Closed

sawfly wants to merge 5 commits into
WordPress:trunkfrom
sawfly:65766-Add-aria-described-for-search-engine-setting

Conversation

@sawfly

@sawfly sawfly commented Jul 31, 2026

Copy link
Copy Markdown

Added attribute aria-describedby

Trac ticket: https://core.trac.wordpress.org/ticket/65766

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sawf1y, afercia, abcd95.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

<td><fieldset>
<legend class="screen-reader-text"><span><?php echo $blog_privacy_selector_title; ?></span></legend>
<?php if ( has_action( 'blog_privacy_selector' ) ) : ?>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />

@himanshupathak95 himanshupathak95 Aug 3, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also add aria-describedby="public-desc" to the radio buttons here and id="public-desc" to the <p class="description"> here as well? This will ensure the setting is fully accessible even when blog_privacy_selector is active, matching wp-admin/install.php

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File wp-admin/install.php contains aria-describedby attribute within input id="blog-norobots". Should I add aria-describedby to input.blog-public, input.blog-norobots or probably both?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add aria-describedby to input.blog-public, input.blog-norobots or probably both?

Sorry, I missed this reply.

Comment thread src/wp-admin/options-reading.php Outdated
?>
<?php else : ?>
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" aria-describedby="privacy-desc" <?php checked( '0', get_option( 'blog_public' ) ); ?> />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For attribute consistency with wp-admin/install.php#L201, let's move aria-describedby="privacy-desc" to right after id="blog_public

@sawfly
sawfly requested a review from himanshupathak95 August 3, 2026 13:45
@himanshupathak95

Copy link
Copy Markdown

Thanks for updating the attribute ordering, @sawfly! That looks much cleaner now.

Just a reminder regarding the remaining part of the review: the radio button section inside if ( has_action( 'blog_privacy_selector' ) ) (lines 215–219) is still missing aria-describedby and an id on its description paragraph.

To make the accessibility fix complete across all view states, could you also update that branch? In wp-admin/install.php, core handles this exact radio button setup similarly, you can refer from there for consistency check.

@sawfly

sawfly commented Aug 4, 2026

Copy link
Copy Markdown
Author

Thanks for updating the attribute ordering, @sawfly! That looks much cleaner now.

Just a reminder regarding the remaining part of the review: the radio button section inside if ( has_action( 'blog_privacy_selector' ) ) (lines 215–219) is still missing aria-describedby and an id on its description paragraph.

To make the accessibility fix complete across all view states, could you also update that branch? In wp-admin/install.php, core handles this exact radio button setup similarly, you can refer from there for consistency check.

Dear @himanshupathak95 . Thanks for your involving in this PR. I've done as you asked to match install.php. In this comment you had asked to add aria-describedby to both radio buttons? In wp-admin/install.php the first radio button does not have attribute aria-describedby. I asked you in reply. So, if the goal was to match public visibiliti option exactly with wp-admin/install.php, that it have done now

@himanshupathak95 himanshupathak95 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify my earlier comment: yes, only #blog-norobots needs aria-describedby, not #blog-public. The description text is a caveat specifically about how the discouraging option works, so linking it only to that input is semantically accurate.

Both branches now look correct. I think the fix is now complete and consistent across both view states.

@afercia
afercia force-pushed the 65766-Add-aria-described-for-search-engine-setting branch from b177029 to a25196c Compare September 19, 2026 11:29
@afercia

afercia commented Sep 19, 2026

Copy link
Copy Markdown
Member

I rebased the PR and updated it to conditionally set aria-describedby in the fieldset.
Plus, other a11y improvements to use explicit labeling etc.
Also updated the install.php page.

@afercia
afercia force-pushed the 65766-Add-aria-described-for-search-engine-setting branch from a25196c to a0113ff Compare September 19, 2026 11:32
Comment thread src/wp-admin/install.php
<td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="user_login"><?php _e( 'Username' ); ?></label></th>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label was not associated with any input when $user_table is truthy, as the input is rendered conditionally.

@afercia afercia added the props-bot Adding this label triggers the Props Bot workflow for a PR. label Sep 20, 2026
@github-actions github-actions Bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label Sep 20, 2026
wporg-sync pushed a commit that referenced this pull request Sep 20, 2026
…ility.

Conditionally associates the description of the Search engine visibility setting on the Reading Settings and Install pages:
- When the setting shows two radio buttons, the description is associated to the wrapping fieldset element.
- Otherwise, it is associated to the checkbox.

Additionally:
- Fixes an orphaned label element in the Install page.
- Replaces implicit labeling (label elements that wrap inputs) with explicit labeling.

Developed in #12794

Props sawf1y, abcd95, afercia, joedolson.
Fixes #65766.


git-svn-id: https://develop.svn.wordpress.org/trunk@63762 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Sep 20, 2026
…ility.

Conditionally associates the description of the Search engine visibility setting on the Reading Settings and Install pages:
- When the setting shows two radio buttons, the description is associated to the wrapping fieldset element.
- Otherwise, it is associated to the checkbox.

Additionally:
- Fixes an orphaned label element in the Install page.
- Replaces implicit labeling (label elements that wrap inputs) with explicit labeling.

Developed in WordPress/wordpress-develop#12794

Props sawf1y, abcd95, afercia, joedolson.
Fixes #65766.

Built from https://develop.svn.wordpress.org/trunk@63762


git-svn-id: http://core.svn.wordpress.org/trunk@62934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@afercia

afercia commented Sep 20, 2026

Copy link
Copy Markdown
Member

@afercia afercia closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants