Skip to content

Conversation

@ntsekouras
Copy link
Contributor

What?

This PR handles the case of published posts with no title. Caught by @tyxla

Testing Instructions

  1. In a published page with no title insert the breadcrumbs block.
  2. Observe the front-end that displays the fallback.

Screenshots or screencast

Screenshot 2025-10-31 at 12 38 04 PM

@ntsekouras ntsekouras self-assigned this Oct 31, 2025
@ntsekouras ntsekouras added the [Type] Bug An existing feature does not function as intended label Oct 31, 2025
@ntsekouras ntsekouras added the [Block] Breadcrumbs (experimental) Affects the Breadcrumbs Block label Oct 31, 2025
@github-actions
Copy link

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: tyxla <[email protected]>

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

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

LGTM, thanks 👍

Image

Comment on lines +179 to +182
$title = get_the_title( $ancestor_id );
if ( strlen( $title ) === 0 ) {
$title = __( '(no title)' );
}
Copy link
Member

Choose a reason for hiding this comment

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

Optional: This is a bit repetitive with the above, so we could possibly abstract into a function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look into more possible reusable functions soon. Actually I mentioned something similar here.

@ntsekouras ntsekouras merged commit 8e49c8b into trunk Oct 31, 2025
36 checks passed
@ntsekouras ntsekouras deleted the breadcrumbs-add-fallback-title branch October 31, 2025 12:04
@github-actions github-actions bot added this to the Gutenberg 22.1 milestone Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Breadcrumbs (experimental) Affects the Breadcrumbs Block [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants