Skip to content

Navigation Link: Hide Add Submenu button in contentOnly mode#71353

Open
Adi-ty wants to merge 1 commit intoWordPress:trunkfrom
Adi-ty:fix/navigation-link-content-only-toolbar
Open

Navigation Link: Hide Add Submenu button in contentOnly mode#71353
Adi-ty wants to merge 1 commit intoWordPress:trunkfrom
Adi-ty:fix/navigation-link-content-only-toolbar

Conversation

@Adi-ty
Copy link
Copy Markdown
Contributor

@Adi-ty Adi-ty commented Aug 26, 2025

What?

Closes #71180

Modifies the Navigation Link block toolbar to show only content-editing tools when in contentOnly editing mode.

Why?

The Navigation Link block was showing all toolbar controls even in contentOnly mode, which should be limited to content-only editing capabilities.

How?

Hidden add Submenu button in contentOnly mode

Testing Instructions

  1. Create a Navigation block with Navigation Link items
  2. Select a Navigation Link block (not the parent Navigation)
  3. Set to contentOnly mode in browser console or directly via code editor
    const clientId = wp.data.select('core/block-editor').getSelectedBlockClientId();
    wp.data.dispatch('core/block-editor').setBlockEditingMode(clientId, 'contentOnly');
  4. Add submenu button should be hidden

Screenshots or screencast

Before After
Screenshot 2025-08-26 at 5 30 59 PM Screenshot 2025-08-26 at 5 35 36 PM

@Adi-ty Adi-ty marked this pull request as ready for review August 26, 2025 20:17
@github-actions
Copy link
Copy Markdown

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: Adi-ty <iamadisingh@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>

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

@github-actions
Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin, New Block.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

1 similar comment
@github-actions
Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin, New Block.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

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.

Navigation Link: Modify the Block Toolbar in contentOnly

1 participant