Skip to content

[Accessibility] Introduce aria-label argument to variation attributes dropdown #60265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

peterwilsoncc
Copy link
Contributor

@peterwilsoncc peterwilsoncc commented Aug 8, 2025

Submission Review Guidelines:

Changes proposed in this Pull Request:

Introduces the argument aria-label to the function wc_dropdown_variation_attribute_options() to allow for extensions wishing to add the aria-label parameter.

The use case for this is for instances in which multiple variations appear on the same page that are using the same name, see https://github.com/woocommerce/woocommerce-product-bundles/pull/1557 for an example.

With the attribute, the code output on the opening select element is as follows (re-formatted for clarity):

<select
 id="variation_id" 
 class="" 
 name="bundle_attribute_variation_id"
 aria-label="variation aria label"
 data-attribute_name="attribute_variation"
 data-show_option_none="yes">

Closes #60120.
Closes WOOPLUG-5230

Screenshots or screen recordings:

How to test the changes in this Pull Request:

  1. In the variable.php template, hack the code to include an aria-label argument
    wc_dropdown_variation_attribute_options(
    array(
    'options' => $options,
    'attribute' => $attribute_name,
    'product' => $product,
    )
    );
  2. Create a variable product
  3. View the variable product in your browser
  4. View source
  5. Ensure the aria-label attribute is displayed
  6. Remove the hacked code
  7. Reload the source
  8. Ensure the aria-label attribute is not displayed

Testing that has already taken place:

Tested with Product Bundles extension

  • added aria-label as an argument in the bundled-product-variable.php file
  • ensured that the aria-label displayed as expected
  • Run the modified unit tests added in this PR, phpunit --filter WC_Tests_Template_Functions

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Introduce aria-label argument to the function wc_dropdown_variation_attribute_options()

Changelog Entry Comment

Comment

@github-actions github-actions bot added type: community contribution plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Aug 8, 2025
@peterwilsoncc peterwilsoncc marked this pull request as ready for review August 8, 2025 02:12
@peterwilsoncc
Copy link
Contributor Author

@PanosSynetos I've picked this up from @Manussakis while he is out of the office.

The description on the ticket mentions using the option aria_label, however I've used aria-label as the latter is used in WooCommerce Core for the purpose in other parts of the code base whereas the former is unused. For example

'attributes' => array(
'data-product_id' => $product->get_id(),
'data-product_sku' => $product->get_sku(),
'aria-label' => $product->add_to_cart_description(),
'rel' => 'nofollow',
),

I unable to request reviews on this repo, please consider this comment as such a request.

Copy link
Contributor

coderabbitai bot commented Aug 8, 2025

📝 Walkthrough

Walkthrough

Added an optional aria-label argument to wc_dropdown_variation_attribute_options() and conditionally render an aria-label attribute on the generated <select>. Four unit tests were added to verify presence, escaping, and omission for falsey values.

Changes

Cohort / File(s) Change Summary
Changelog Documentation
plugins/woocommerce/changelog/60265-enh-60120-aria-label-for-variation-dropdown
Documents the new aria-label argument for variation dropdowns.
Function Enhancement
plugins/woocommerce/includes/wc-template-functions.php
Adds an optional 'aria-label' => false default to wc_dropdown_variation_attribute_options() and conditionally outputs aria-label="..." on the <select> when provided (escaped).
Unit Test Additions
plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
Adds four tests to WC_Tests_Template_Functions: checks rendering of aria-label when defined, escaping of the attribute, omission for various falsey values, and provides a data provider for falsey values.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant wc_dropdown_variation_attribute_options
    participant HTML_Output

    Caller->>wc_dropdown_variation_attribute_options: Call with args (may include aria-label)
    wc_dropdown_variation_attribute_options->>wc_dropdown_variation_attribute_options: Merge args with defaults (aria-label => false)
    wc_dropdown_variation_attribute_options->>wc_dropdown_variation_attribute_options: Build <select> attributes
    alt aria-label is provided and non-empty
        wc_dropdown_variation_attribute_options->>HTML_Output: Include aria-label="escaped value" on <select>
    else
        wc_dropdown_variation_attribute_options->>HTML_Output: Do not include aria-label on <select>
    end
    wc_dropdown_variation_attribute_options->>Caller: Return HTML string
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9db7949 and c097512.

📒 Files selected for processing (1)
  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8455e49 and 58dc952.

📒 Files selected for processing (3)
  • plugins/woocommerce/changelog/60265-enh-60120-aria-label-for-variation-dropdown (1 hunks)
  • plugins/woocommerce/includes/wc-template-functions.php (2 hunks)
  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/code-quality.mdc)

**/*.{php,js,jsx,ts,tsx}: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable

Files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
  • plugins/woocommerce/includes/wc-template-functions.php
**/*.{php,js,ts,jsx,tsx}

⚙️ CodeRabbit Configuration File

**/*.{php,js,ts,jsx,tsx}: Don't trust that extension developers will follow the best practices, make sure the code:

  • Guards against unexpected inputs.
  • Sanitizes and validates any potentially dangerous inputs.
  • Is backwards compatible.
  • Is readable and intuitive.
  • Has unit or E2E tests where applicable.

Files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
  • plugins/woocommerce/includes/wc-template-functions.php
🧠 Learnings (6)
📓 Common learnings
Learnt from: kmanijak
PR: woocommerce/woocommerce#60154
File: plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx:80-80
Timestamp: 2025-08-04T11:58:34.139Z
Learning: In WooCommerce block Edit components (like plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx), buttons are preview/display elements for the block editor interface and are not meant to be interactive, so accessibility attributes like ARIA labels are not necessary for these non-functional preview buttons.
Learnt from: dinhtungdu
PR: woocommerce/woocommerce#59900
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx:0-0
Timestamp: 2025-07-24T05:37:00.907Z
Learning: The DisplayStyleSwitcher component in plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/components/display-style-switcher/index.tsx has been updated so that its onChange prop accepts only a string type (not string | number | undefined), eliminating the need for type assertions when using this component.
📚 Learning: 2025-07-24T05:37:00.907Z
Learnt from: dinhtungdu
PR: woocommerce/woocommerce#59900
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx:0-0
Timestamp: 2025-07-24T05:37:00.907Z
Learning: The DisplayStyleSwitcher component in plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/components/display-style-switcher/index.tsx has been updated so that its onChange prop accepts only a string type (not string | number | undefined), eliminating the need for type assertions when using this component.

Applied to files:

  • plugins/woocommerce/changelog/60265-enh-60120-aria-label-for-variation-dropdown
  • plugins/woocommerce/includes/wc-template-functions.php
📚 Learning: 2025-08-04T11:58:34.139Z
Learnt from: kmanijak
PR: woocommerce/woocommerce#60154
File: plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx:80-80
Timestamp: 2025-08-04T11:58:34.139Z
Learning: In WooCommerce block Edit components (like plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx), buttons are preview/display elements for the block editor interface and are not meant to be interactive, so accessibility attributes like ARIA labels are not necessary for these non-functional preview buttons.

Applied to files:

  • plugins/woocommerce/changelog/60265-enh-60120-aria-label-for-variation-dropdown
📚 Learning: 2025-08-07T10:34:27.702Z
Learnt from: jorgeatorres
PR: woocommerce/woocommerce#60250
File: .github/workflows/release-compile-changelog.yml:165-166
Timestamp: 2025-08-07T10:34:27.702Z
Learning: In WooCommerce release workflows, the VERSION variable used in changelog generation comes from the `validate-selected-branch-version` step, which extracts the version from `plugins/woocommerce/woocommerce.php` using `grep -oP '(?<=Version: )(.+)'` and validates it matches the input version. This ensures the version is always in the correct format by the time it reaches the changelog generation step, making additional error handling for version format validation unnecessary.

Applied to files:

  • plugins/woocommerce/changelog/60265-enh-60120-aria-label-for-variation-dropdown
📚 Learning: 2025-06-16T09:20:22.981Z
Learnt from: gigitux
PR: woocommerce/woocommerce#58846
File: plugins/woocommerce/client/blocks/tests/e2e/tests/all-products/all-products.block_theme.spec.ts:41-52
Timestamp: 2025-06-16T09:20:22.981Z
Learning: In WooCommerce E2E tests, the database is reset to the initial state for each test, so there's no need to manually restore global template changes (like clearing the header template) as the test infrastructure handles cleanup automatically.

Applied to files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
📚 Learning: 2025-06-18T09:58:10.616Z
Learnt from: vladolaru
PR: woocommerce/woocommerce#58784
File: plugins/woocommerce/src/Internal/Admin/Settings/PaymentsProviders/Paytrail.php:29-35
Timestamp: 2025-06-18T09:58:10.616Z
Learning: In WooCommerce codebase, prefer using `wc_string_to_bool()` over `filter_var($value, FILTER_VALIDATE_BOOLEAN)` when converting option values (especially 'yes'/'no' style flags) to boolean. The WooCommerce helper function is more idiomatic and handles the conversion consistently with core WooCommerce patterns.

Applied to files:

  • plugins/woocommerce/includes/wc-template-functions.php
🔇 Additional comments (3)
plugins/woocommerce/includes/wc-template-functions.php (2)

3355-3355: LGTM! Parameter addition follows WooCommerce conventions.

The new 'aria-label' parameter is properly added with a sensible default value of false, maintaining backwards compatibility and following the existing pattern of optional parameters in the function.


3385-3385: Excellent implementation with proper security measures.

The conditional aria-label attribute addition is well implemented:

  • Uses proper conditional logic to only add the attribute when a value is provided
  • Correctly escapes the attribute value with esc_attr() to prevent XSS
  • Maintains backwards compatibility by not affecting existing functionality
  • Follows WooCommerce HTML output patterns

This enhancement successfully addresses the accessibility requirements outlined in the PR objectives.

plugins/woocommerce/changelog/60265-enh-60120-aria-label-for-variation-dropdown (1)

1-4: LGTM! Changelog entry is accurate and properly categorized.

The changelog entry correctly documents the accessibility enhancement with appropriate significance and type classifications.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php (1)

158-170: Good edge case coverage, but consider adding tests for null values and backwards compatibility.

This test correctly verifies that empty string values result in no aria-label attribute being rendered. However, to complete the edge case coverage mentioned in past reviews, consider adding:

  1. Null values test: Verify behavior when aria-label is explicitly set to null
  2. Backwards compatibility test: Verify behavior when aria-label parameter is completely omitted from the arguments array

Add these additional test methods:

/**
 * Test: aria-label omitted when null value provided.
 */
public function test_wc_dropdown_variation_attribute_omits_aria_label_when_null() {
    $product = WC_Helper_Product::create_variation_product();

    $this->expectOutputString( '<select id="pa_size" class="" name="attribute_pa_size" data-attribute_name="attribute_pa_size" data-show_option_none="yes"><option value="">Choose an option</option><option value="huge" >huge</option><option value="large" >large</option><option value="small" >small</option></select>' );

    wc_dropdown_variation_attribute_options(
        array(
            'product'    => $product,
            'attribute'  => 'pa_size',
            'aria-label' => null,
        )
    );
}

/**
 * Test: backwards compatibility when aria-label parameter is omitted.
 */
public function test_wc_dropdown_variation_attribute_backwards_compatible_without_aria_label() {
    $product = WC_Helper_Product::create_variation_product();

    $this->expectOutputString( '<select id="pa_size" class="" name="attribute_pa_size" data-attribute_name="attribute_pa_size" data-show_option_none="yes"><option value="">Choose an option</option><option value="huge" >huge</option><option value="large" >large</option><option value="small" >small</option></select>' );

    wc_dropdown_variation_attribute_options(
        array(
            'product'   => $product,
            'attribute' => 'pa_size',
            // aria-label intentionally omitted
        )
    );
}
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58dc952 and b208c28.

📒 Files selected for processing (1)
  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/code-quality.mdc)

**/*.{php,js,jsx,ts,tsx}: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable

Files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
**/*.{php,js,ts,jsx,tsx}

⚙️ CodeRabbit Configuration File

**/*.{php,js,ts,jsx,tsx}: Don't trust that extension developers will follow the best practices, make sure the code:

  • Guards against unexpected inputs.
  • Sanitizes and validates any potentially dangerous inputs.
  • Is backwards compatible.
  • Is readable and intuitive.
  • Has unit or E2E tests where applicable.

Files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
🧠 Learnings (6)
📓 Common learnings
Learnt from: kmanijak
PR: woocommerce/woocommerce#60154
File: plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx:80-80
Timestamp: 2025-08-04T11:58:34.139Z
Learning: In WooCommerce block Edit components (like plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx), buttons are preview/display elements for the block editor interface and are not meant to be interactive, so accessibility attributes like ARIA labels are not necessary for these non-functional preview buttons.
Learnt from: dinhtungdu
PR: woocommerce/woocommerce#59900
File: plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/inner-blocks/attribute-filter/inspector.tsx:0-0
Timestamp: 2025-07-24T05:37:00.907Z
Learning: The DisplayStyleSwitcher component in plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/components/display-style-switcher/index.tsx has been updated so that its onChange prop accepts only a string type (not string | number | undefined), eliminating the need for type assertions when using this component.
📚 Learning: 2025-06-16T09:20:22.981Z
Learnt from: gigitux
PR: woocommerce/woocommerce#58846
File: plugins/woocommerce/client/blocks/tests/e2e/tests/all-products/all-products.block_theme.spec.ts:41-52
Timestamp: 2025-06-16T09:20:22.981Z
Learning: In WooCommerce E2E tests, the database is reset to the initial state for each test, so there's no need to manually restore global template changes (like clearing the header template) as the test infrastructure handles cleanup automatically.

Applied to files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
📚 Learning: 2025-06-20T17:38:16.565Z
Learnt from: opr
PR: woocommerce/woocommerce#0
File: :0-0
Timestamp: 2025-06-20T17:38:16.565Z
Learning: WooCommerce legacy JavaScript files in plugins/woocommerce/client/legacy/js/ must use older JavaScript syntax and cannot use modern features like optional chaining (?.) due to browser compatibility requirements. Explicit null checking with && operators should be used instead.

Applied to files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
📚 Learning: 2025-08-01T05:52:57.768Z
Learnt from: dinhtungdu
PR: woocommerce/woocommerce#60142
File: plugins/woocommerce/src/Internal/ProductFilters/TaxonomyHierarchyData.php:71-93
Timestamp: 2025-08-01T05:52:57.768Z
Learning: In plugins/woocommerce/src/Internal/ProductFilters/TaxonomyHierarchyData.php, the get_descendants() and get_ancestors() methods don't need extensive input validation because: 1) the taxonomy parameter is always validated upstream in the controlled WooCommerce core context, and 2) the null coalescing operator (??) already efficiently handles invalid term_id keys in the returned map.

Applied to files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
📚 Learning: 2025-08-04T11:58:34.139Z
Learnt from: kmanijak
PR: woocommerce/woocommerce#60154
File: plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx:80-80
Timestamp: 2025-08-04T11:58:34.139Z
Learning: In WooCommerce block Edit components (like plugins/woocommerce/client/blocks/assets/js/blocks/next-previous-buttons/edit.tsx), buttons are preview/display elements for the block editor interface and are not meant to be interactive, so accessibility attributes like ARIA labels are not necessary for these non-functional preview buttons.

Applied to files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
📚 Learning: 2025-07-18T14:54:36.232Z
Learnt from: CR
PR: woocommerce/woocommerce#0
File: .cursor/rules/code-quality.mdc:0-0
Timestamp: 2025-07-18T14:54:36.232Z
Learning: Applies to **/*.{php,js,jsx,ts,tsx} : Ensure code has unit or E2E tests where applicable

Applied to files:

  • plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
🔇 Additional comments (2)
plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php (2)

124-136: LGTM! Basic aria-label functionality test is well-implemented.

The test correctly verifies that the aria-label attribute is rendered in the dropdown select element when provided. The test setup and assertions are appropriate.


141-153: Excellent XSS protection test!

This test effectively addresses the security concern by verifying that malicious input like JavaScript injection attempts are properly escaped. The expected output shows correct HTML entity encoding, neutralizing potential XSS attacks.

@PanosSynetos PanosSynetos self-requested a review August 8, 2025 05:02
Copy link
Contributor

github-actions bot commented Aug 8, 2025

Testing Guidelines

Hi ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

Copy link
Contributor

@PanosSynetos PanosSynetos left a comment

Choose a reason for hiding this comment

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

Hey @nicdwilson - I've manually tested this and works as expected - pre-approving. As I'm running out of time, I'll leave the code review and tests review to @roccotripaldi

In the meantime, please check the failing linting tests, a docblock is missing in one of the unit tets. If any other tests fail, unrelated to this PR, @roccotripaldi will reach out internally.

. lint:changes:branch:php: FILE: plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php
. lint:changes:branch:php: -----------------------------------------------------------------------------------------------
. lint:changes:branch:php: FOUND 1 ERROR AND 0 WARNINGS AFFECTING 1 LINE
. lint:changes:branch:php: -----------------------------------------------------------------------------------------------
. lint:changes:branch:php:  155 | ERROR | Doc comment for parameter "$attribute_value" missing (Squiz.Commenting.FunctionComment.MissingParamTag)
. lint:changes:branch:php: -----------------------------------------------------------------------------------------------

Pre-approving, thanks!

Copy link
Contributor

@roccotripaldi roccotripaldi left a comment

Choose a reason for hiding this comment

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

I also tested this branch locally, and verified it works. I can add an aria-label by applying a filter in an external plugin.

I'll pre-approve as well. A quick fix to the failing linting test, and this is ready to merge.

@peterwilsoncc
Copy link
Contributor Author

@roccotripaldi I've pushed a fix for the missing @param annotation and merged in trunk.

@roccotripaldi roccotripaldi merged commit 509a376 into woocommerce:trunk Aug 11, 2025
35 checks passed
@github-actions github-actions bot added this to the 10.2.0 milestone Aug 11, 2025
@roccotripaldi
Copy link
Contributor

Thanks @peterwilsoncc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. type: community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Accessibility] The variation attributes dropdown should also accept aria_label as argument
3 participants