Skip to content

Conversation

@bschneidewind
Copy link

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.

@github-actions
Copy link

github-actions bot commented Jan 29, 2025

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.

Unlinked Accounts

The 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:

Props bschneidewind, peterwilsoncc, audrasjb.

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

@github-actions
Copy link

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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • 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.

@audrasjb
Copy link
Contributor

Test report

Settings:

Capture d’écran 2025-01-29 à 11 43 23

Before applying the PR: no aria-current attribute.

Capture d’écran 2025-01-29 à 11 44 09

After applying the PR: aria-current attribute displayed.

Capture d’écran 2025-01-29 à 11 43 48

Test results

This PR fixes the issue 👍

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a 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

@audrasjb
Copy link
Contributor

Thanks for pushing the test cases @peterwilsoncc !

@github-actions
Copy link

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 60062
GitHub commit: 4d19161

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Mar 21, 2025
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