Skip to content

Navigation Link, Navigation Submenu: Remove the title attribute controls#69689

Merged
t-hamano merged 7 commits into
WordPress:trunkfrom
Infinite-Null:remove/title-attribute
Apr 2, 2025
Merged

Navigation Link, Navigation Submenu: Remove the title attribute controls#69689
t-hamano merged 7 commits into
WordPress:trunkfrom
Infinite-Null:remove/title-attribute

Conversation

@Infinite-Null
Copy link
Copy Markdown
Contributor

@Infinite-Null Infinite-Null commented Mar 25, 2025

Closes: #69663

What?

Removes the Title attribute UI option from Navigation Submenu block and Custom Link button to align with accessibility best practices.

Testing Instructions

  1. Open a post or page.
  2. Insert an Image block.
  3. Go to the Inspector control under the advanced section, and see if the title input is there.
  4. Insert the Navigation block and add a submenu and a page link
  5. For both blocks, check if the title input is there.

Screenshots or screencast

Before After
Screenshot 2025-03-27 at 11 41 08 AM Screenshot 2025-03-27 at 11 38 50 AM
Screenshot 2025-03-27 at 11 40 57 AM Screenshot 2025-03-27 at 11 39 07 AM

@Mamaduka Mamaduka changed the title Remove Title attribute controls Navigation Link/Submenu: Remove the title attribute controls Mar 25, 2025
@Mamaduka Mamaduka added [Block] Navigation Link Affects the Navigation Link Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Type] Enhancement A suggestion for improvement. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Mar 25, 2025
@Infinite-Null Infinite-Null marked this pull request as ready for review March 27, 2025 06:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 27, 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.

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: Infinite-Null <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: joedolson <[email protected]>

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

@Infinite-Null Infinite-Null changed the title Navigation Link/Submenu: Remove the title attribute controls Remove the title attribute controls Mar 27, 2025
@Infinite-Null
Copy link
Copy Markdown
Contributor Author

The failing tests don’t seem to be related to the changes in this PR.

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

I think it would be good to focus only on two blocks, core/navigation-link and core/navigation-submenu in this PR.

If we plan to remove the title attribute from the Image block, we need to address the following tasks:

  • If we update the save function, we will need to add a block deprecation.
  • The title attribute is allowed to be used as Block Binding API (See this core code). This means that we may need to prepare a patch that removes the title attribute from the supported attributes to the core along with this PR.

I think It's too big to tackle all the tasks in one PR.

@Infinite-Null
Copy link
Copy Markdown
Contributor Author

Hi @t-hamano,
I have updated the PR to remove title input from core/navigation-submenu and core/navigation-link. Could you please review this at your convenience.
Thank You!

@Infinite-Null Infinite-Null requested a review from t-hamano March 31, 2025 06:02
@t-hamano t-hamano changed the title Remove the title attribute controls Navigation Link, Navigation Submenu: Remove the title attribute controls Mar 31, 2025
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

I think we need to completely remove code related to the title attribute. For example:

if ( isset( $attributes['title'] ) ) {
$html .= ' title="' . esc_attr( $attributes['title'] ) . '"';
}

It's a good idea to go through the code in both blocks and look for anything that needs to be removed.

@Infinite-Null
Copy link
Copy Markdown
Contributor Author

Hi @t-hamano,
I have updated the PR and removed the title attribute from other places as well. Could you please review it at your convenience and let me know if I’ve missed anything?

Thank You!

@Infinite-Null Infinite-Null requested a review from t-hamano April 1, 2025 06:23
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! I think all code related to the title attribute has been removed.

Since I think this change is very important for site builders, I'm adding a Needs dev note label to announce it in the next major release.

@t-hamano t-hamano added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Apr 2, 2025
@t-hamano t-hamano merged commit 6985f08 into WordPress:trunk Apr 2, 2025
@github-actions github-actions Bot added this to the Gutenberg 20.7 milestone Apr 2, 2025
Infinite-Null added a commit to Infinite-Null/gutenberg that referenced this pull request May 28, 2025
t-hamano added a commit that referenced this pull request May 29, 2025
…ping attribute support (#70234)

* Revert the changes from PR #69689

* Remove title attribute from Controls in Navigation Link and Submenu blocks

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: t-hamano <[email protected]>
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ols (WordPress#69689)

* Remove Title attribute controls

* Remove Title controls from Image component

* Remove 'title' attribute from navigation link and submenu blocks

* Remove title attribute checks from custom sources tests

* Revert image changes

* Remove `title` attribute from navigation link and submenu blocks

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: joedolson <[email protected]>
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ping attribute support (WordPress#70234)

* Revert the changes from PR WordPress#69689

* Remove title attribute from Controls in Navigation Link and Submenu blocks

Co-authored-by: Infinite-Null <[email protected]>
Co-authored-by: t-hamano <[email protected]>
@priethor priethor mentioned this pull request Oct 16, 2025
24 tasks
@priethor
Copy link
Copy Markdown
Contributor

@t-hamano do you think it makes sense to combine this PR's dev note with the other deprecations?

@t-hamano
Copy link
Copy Markdown
Contributor

@priethor As a follow-up to this PR, I recalled that the title attribute was restored internally in #70234. This means that only the title UI control was removed, so it doesn't affect backward compatibility. Therefore, I think a Dev Note is unnecessary.

@t-hamano t-hamano removed the Needs Dev Note Requires a developer note for a major WordPress release cycle label Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Navigation Link Affects the Navigation Link Block [Block] Submenu Affects the Submenu Block - for submenus in navigation [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation Submenu, Custom Link Block: Consider removing the title editing UI

4 participants