CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 19:22:07 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/WordPress/gutenberg.git
etag: W/"2a42c5f83719189f29ee8fde3e93fa43"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=FzeLJkgZx0WpNPECQlG%2FhIZzQCRFmzwkW7a9x2Lx%2FZ4v46dtI3XTS0Sxcdj0i2sYv84Mqj6Y3a%2BpzEzGfgao%2FkzZ%2FDewfWH9MWCRjLCON8aprbS1xIfA%2FMH%2F9ljGdQbgfa058SAeuVAkysZ0csChqEzkb%2FSWFrsEs%2Bk9P%2FIy3Ctb8qQjbmGprTdpNOHk4Nb0qmvRp30cpAXOY%2F0pATLFJ1%2BmPZzsbqXQps5ckYgI903HlrWzNkT4soLBmxNoucWCwj%2BjCIt77S%2F3iZ5AZ%2BtHhQ%3D%3D--YMpd0n58%2B4F3Wo33--Hwjn96GeKSB1400I%2BCu%2F1Q%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2134885166.1760210526; Path=/; Domain=github.com; Expires=Sun, 11 Oct 2026 19:22:06 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 11 Oct 2026 19:22:06 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 8D16:366CA0:9DAC7F:CE3106:68EAAE5E
Add Navigation Add Page Button (#71192) · WordPress/gutenberg@e9daf2a · GitHub
Copy file name to clipboardExpand all lines: packages/block-library/src/navigation/edit/index.js
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit e9daf2a
Add Navigation Add Page Button (#71192)
* Add Add page button to Navigation block toolbar
- Creates a new hook that adds an Add page button to Navigation blocks
- Button appears in the block toolbar when Navigation block is selected
- Clicking the button inserts a new navigation-link block at the end
- Hook follows the same pattern as navigation-link-view-button.js
- Button works in all editing modes (not just contentOnly)
* Fix Navigation Link Block to use contentOnly mode
- Added useBlockEditingMode hook import
- Used useBlockEditingMode() to get current block editing mode
- Fixed undefined blockEditingMode variable error
- Navigation Link Block now properly respects contentOnly mode
* Move Navigation Add Page Button from hook to Navigation block
- Moved NavigationAddPageButton component directly into Navigation block edit/index.js
- Added required imports: ToolbarButton, ToolbarGroup, page icon, createBlock, __unstableBlockToolbarLastItem
- Removed old navigation-add-page-button.js hook file
- Removed import from hooks/index.js
- Component now renders directly in Navigation block when isEntityAvailable is true
- Maintains same functionality: only shows in contentOnly mode
* Use DEFAULT_BLOCK constant from constants.js for createBlock
- Import DEFAULT_BLOCK from ../constants
- Replace hardcoded 'core/navigation-link' with DEFAULT_BLOCK.name
- Makes the code more maintainable and consistent with constants usage
* Use DEFAULT_BLOCK attributes when creating navigation link block
- Pass kind and type attributes from DEFAULT_BLOCK constant to createBlock
- Ensures new navigation link blocks are created with consistent default attributes
- Makes the block creation more robust and aligned with constants
* Pull in correct attributes for new block
Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>1 parent c3f4b72 commit e9daf2aCopy full SHA for e9daf2a
File tree
Expand file treeCollapse file tree
1 file changed
+50
-1
lines changedFilter options
- packages/block-library/src/navigation/edit
Expand file treeCollapse file tree
1 file changed
+50
-1
lines changedCollapse file: packages/block-library/src/navigation/edit/index.js
packages/block-library/src/navigation/edit/index.js
Copy file name to clipboardExpand all lines: packages/block-library/src/navigation/edit/index.js+50-1Lines changed: 50 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
40 | 41 |
| |
41 | 42 |
| |
42 | 43 |
| |
| 44 | + | |
| 45 | + | |
43 | 46 |
| |
44 | 47 |
| |
45 | 48 |
| |
46 |
| - | |
| 49 | + | |
| 50 | + | |
47 | 51 |
| |
48 | 52 |
| |
49 | 53 |
| |
| |||
75 | 79 |
| |
76 | 80 |
| |
77 | 81 |
| |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
78 | 124 |
| |
79 | 125 |
| |
80 | 126 |
| |
| |||
937 | 983 |
| |
938 | 984 |
| |
939 | 985 |
| |
| 986 | + | |
| 987 | + | |
| 988 | + | |
940 | 989 |
| |
941 | 990 |
| |
942 | 991 |
| |
|
You can’t perform that action at this time.
0 commit comments