-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Update aria-current application on get_custom_logo #8206
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
|
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @bjschneidewind@santanderconsumerusa.com. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
peterwilsoncc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bschneidewind This looks good to me and tests well, thank you!
I've taken the liberty of merging in trunk and pushing some tests to your branch.
Running the tests on trunk shows that they fail:
$ phpunit --group 62879
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.
Warning: Your XML configuration validates against a deprecated schema.
Suggestion: Migrate your XML configuration using "--migrate-configuration"!
...FF...... 11 / 11 (100%)
Time: 00:00.222, Memory: 213.89 MB
There were 2 failures:
1) Tests_General_Template::test_get_custom_logo_aria_current_attribute_blog_set_to_page_without_front_page_defined with data set "Front page" ('http://example.org', true)
Custom logo is expected to contain aria-current attribute
Failed asserting that '<a href="http://example.org/" class="custom-logo-link" rel="home"><img width="50" height="50" src="http://example.org/wp-content/uploads/2025/03/test-image-83.jpg" class="custom-logo" alt="Test Blog" decoding="async" /></a>' contains "aria-current="page"".
/vagrant/wordpress-develop/tests/phpunit/tests/general/template.php:616
2) Tests_General_Template::test_get_custom_logo_aria_current_attribute_blog_set_to_page_without_front_page_defined with data set "Blog index" ('http://example.org/blog/', true)
Custom logo is expected to contain aria-current attribute
Failed asserting that '<a href="http://example.org/" class="custom-logo-link" rel="home"><img width="50" height="50" src="http://example.org/wp-content/uploads/2025/03/test-image-84.jpg" class="custom-logo" alt="Test Blog" decoding="async" /></a>' contains "aria-current="page"".
/vagrant/wordpress-develop/tests/phpunit/tests/general/template.php:616
On this branch they pass:
$ phpunit --group 62879
Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml
Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.
Warning: Your XML configuration validates against a deprecated schema.
Suggestion: Migrate your XML configuration using "--migrate-configuration"!
........... 11 / 11 (100%)
Time: 00:00.223, Memory: 213.89 MB
|
Thanks for pushing the test cases @peterwilsoncc ! |



When reading settings have a posts page set but not a page set for the homepage - get_custom_logo does not apply the aria-current attribute to the logo link on the homepage.
Trac ticket: https://core.trac.wordpress.org/ticket/62879
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.