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

Fix: Add isNavigationBlock utility to identify navigation blocks #68647

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Jan 14, 2025

What, Why and How?

While determining the Block Information, the Navigation block is incorrectly excluded as a synced block. This PR addresses and resolves that issue.

Testing Instructions

  1. Navigate to the site editor.
  2. Create a Navigation block.
  3. Notice, the block's name is displayed in the Block Card.

Screenshots

Before
before
After
after

Closes: #68646

@Mamaduka
Copy link
Member

@yogeshbhutkar, as mentioned in the previous PR, it's better to create an issue and discuss possible solutions before moving on to code.

I also don't think there's a need to introduce another public method just to check the block's name.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. Needs Decision Needs a decision to be actionable or relevant [Package] Block editor /packages/block-editor labels Jan 14, 2025
@yogeshbhutkar yogeshbhutkar marked this pull request as ready for review January 14, 2025 04:47
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: yogeshbhutkar <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

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

@yogeshbhutkar
Copy link
Contributor Author

yogeshbhutkar commented Jan 14, 2025

Apologies! Let's first discuss the possible approaches in the parent issue.

Maybe, we can also expose just a single method that checks whether a block is synced. Otherwise, the array iteration method tagged in the comment would work great as well. But, I believe we should first establish if this is intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Decision Needs a decision to be actionable or relevant [Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation Block: Treat Navigation Block as a synced block
2 participants