Skip to content

Navigation Link: Add visibility option for logged-in users#70654

Closed
prasadkarmalkar wants to merge 1 commit intoWordPress:trunkfrom
prasadkarmalkar:issue/70605
Closed

Navigation Link: Add visibility option for logged-in users#70654
prasadkarmalkar wants to merge 1 commit intoWordPress:trunkfrom
prasadkarmalkar:issue/70605

Conversation

@prasadkarmalkar
Copy link
Copy Markdown
Contributor

What?

Closes #70605

Add a checkbox to show the navigation link to only logged in user.

Why?

Currently, there is no built-in way to add conditions to menus, such as displaying different menu items when a user is logged in or logged out.

How?

  • Created a checkbox option in navigation-link and set a attribute
  • While dynamically rendering menu check attribute and display only if its set and user is logged in

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Screen.Recording.2025-07-09.at.1.12.30.PM.mov
Before After
Screenshot 2025-07-09 at 1 14 37 PM Screenshot 2025-07-09 at 1 15 41 PM

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 9, 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: prasadkarmalkar <prasadkarmalkar@git.wordpress.org>
Co-authored-by: jartes <jartes@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Navigation Link Affects the Navigation Link Block labels Jul 9, 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 [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add conditional options in menu items

2 participants