Add a page, link, or another item to your navigation.
- Name:
core/navigation-link - Category: design
- API Version: 3
- Block Type: Hybrid (static save + server enhancements)
Block Relationships
Parent blocks (direct):
– core/navigation
Allowed inner blocks:
– core/navigation-link
– core/navigation-submenu
– core/page-list
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
label |
string |
— | Role: content |
type |
string |
— | — |
description |
string |
— | — |
rel |
string |
— | — |
id |
number |
— | — |
opensInNewTab |
boolean |
false |
— |
url |
string |
— | Role: content |
title |
string |
— | — |
kind |
string |
— | — |
isTopLevelLink |
boolean |
— | — |
Supports
Defined via the supports property in block.json.
anchor:truereusable:falsehtml:falsetypography:fontSize:truelineHeight:true
renaming:falseinteractivity:clientNavigation:true
Context
Defined via the usesContext and providesContext properties in block.json.
Uses context:
textColorcustomTextColorbackgroundColorcustomBackgroundColoroverlayTextColorcustomOverlayTextColoroverlayBackgroundColorcustomOverlayBackgroundColorfontSizecustomFontSizeshowSubmenuIconmaxNestingLevelstyle
CSS Selectors
Defined via the selectors property in block.json.
- states:
- -current:
.wp-block-navigation .current-menu-item
- -current:
Block Markup
This is a hybrid block. It saves static markup that the server may enhance during rendering.
<!-- wp:navigation-link {"label":"WordPress","url":"https://wordpress.org/"} -->
<!-- /wp:navigation-link -->
Source
- block.json (reference)
- Source directory — browse
edit.js,save.js,index.php, and more.