Skip to content
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

Site Breadcrumbs: Return empty string when breadcrumbs is an empty array #637

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

renintw
Copy link
Contributor

@renintw renintw commented Jul 7, 2024

In the design of most wporg sites, breadcrumbs are not needed when the level is less than 3. Therefore, a filter is usually applied to the breadcrumbs block to make the breadcrumbs an empty array. If this early return is not implemented, it would still return a div that occupies space.

See WordPress/Learn@6fa130a

In the design of most wporg sites, breadcrumbs are not needed when the level is less than 3. Therefore, a filter is usually applied to the breadcrumbs block to make the breadcrumbs an empty array. If this early return is not implemented, it would still return a div that occupies space.

See WordPress/Learn@6fa130a
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

I haven't tested, but this makes sense to me 👍

@renintw renintw merged commit 0ad5629 into trunk Jul 8, 2024
2 checks passed
@renintw renintw deleted the 2511-align-local-nav branch July 8, 2024 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants