From 3bb63e41723f9e986a0c43a03378305c4be13e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Wrede?= Date: Wed, 1 Feb 2023 08:51:27 +0100 Subject: [PATCH] Add anchor support for dynamic blocks (#44771) * Add anchor support * Add anchor support * Remove duplicate block support after merge conflict * Use wp_should_skip_block_supports_serialization --------- Co-authored-by: Carolina Nymark Co-authored-by: Carolina Nymark --- .../block-api/block-supports.md | 2 +- docs/reference-guides/core-blocks.md | 106 +++++++++--------- lib/block-supports/anchor.php | 67 +++++++++++ lib/load.php | 1 + .../block-library/src/archives/block.json | 1 + packages/block-library/src/avatar/block.json | 1 + .../block-library/src/calendar/block.json | 1 + .../block-library/src/categories/block.json | 1 + .../src/comment-author-avatar/block.json | 1 + .../src/comment-author-name/block.json | 1 + .../src/comment-content/block.json | 1 + .../block-library/src/comment-date/block.json | 1 + .../src/comment-edit-link/block.json | 1 + .../src/comment-reply-link/block.json | 1 + .../src/comment-template/block.json | 1 + .../src/comments-pagination-next/block.json | 1 + .../comments-pagination-numbers/block.json | 1 + .../comments-pagination-previous/block.json | 1 + .../src/comments-pagination/block.json | 1 + .../block-library/src/comments/block.json | 3 +- .../block-library/src/home-link/block.json | 1 + .../src/latest-comments/block.json | 1 + .../block-library/src/latest-posts/block.json | 1 + .../block-library/src/loginout/block.json | 1 + .../block-library/src/navigation/block.json | 1 + .../block-library/src/page-list/block.json | 1 + .../src/post-author-biography/block.json | 1 + .../src/post-author-name/block.json | 1 + .../block-library/src/post-author/block.json | 1 + .../src/post-comments-count/block.json | 1 + .../src/post-comments-form/block.json | 1 + .../src/post-comments-link/block.json | 1 + .../block-library/src/post-content/block.json | 1 + .../block-library/src/post-date/block.json | 1 + .../block-library/src/post-excerpt/block.json | 1 + .../src/post-featured-image/block.json | 1 + .../src/post-navigation-link/block.json | 1 + .../src/post-template/block.json | 1 + .../block-library/src/post-terms/block.json | 1 + .../block-library/src/post-title/block.json | 1 + .../src/query-no-results/block.json | 1 + .../src/query-pagination-next/block.json | 1 + .../src/query-pagination-numbers/block.json | 1 + .../src/query-pagination-previous/block.json | 1 + .../src/query-pagination/block.json | 1 + .../block-library/src/query-title/block.json | 1 + packages/block-library/src/query/block.json | 1 + .../block-library/src/read-more/block.json | 1 + packages/block-library/src/rss/block.json | 1 + packages/block-library/src/search/block.json | 1 + .../block-library/src/site-logo/block.json | 1 + .../block-library/src/site-tagline/block.json | 1 + .../block-library/src/site-title/block.json | 1 + .../block-library/src/social-link/block.json | 1 + .../block-library/src/tag-cloud/block.json | 1 + .../src/template-part/block.json | 1 + .../src/term-description/block.json | 1 + 57 files changed, 176 insertions(+), 55 deletions(-) create mode 100644 lib/block-supports/anchor.php diff --git a/docs/reference-guides/block-api/block-supports.md b/docs/reference-guides/block-api/block-supports.md index 68afd793231eff..0fb98783b484a3 100644 --- a/docs/reference-guides/block-api/block-supports.md +++ b/docs/reference-guides/block-api/block-supports.md @@ -48,7 +48,7 @@ function render_block() { - Type: `boolean` - Default value: `false` -Anchors let you link directly to a specific block on a page. This property adds a field to define an id for the block and a button to copy the direct link. _Important: It doesn't work with dynamic blocks yet._ +Anchors let you link directly to a specific block on a page. This property adds a field to define an id for the block and a button to copy the direct link. ```js // Declare support for anchor links. diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 875af65f62ef90..d18ac79b8270c6 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -14,7 +14,7 @@ Display a date archive of your posts. ([Source](https://github.com/WordPress/gut - **Name:** core/archives - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, anchor, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayAsDropdown, showLabel, showPostCounts, type ## Audio @@ -32,7 +32,7 @@ Add a user’s avatar. ([Source](https://github.com/WordPress/gutenberg/tree/tru - **Name:** core/avatar - **Category:** theme -- **Supports:** align, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~ +- **Supports:** align, anchor, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~ - **Attributes:** isLink, linkTarget, size, userId ## Reusable block @@ -68,7 +68,7 @@ A calendar of your site’s posts. ([Source](https://github.com/WordPress/gutenb - **Name:** core/calendar - **Category:** widgets -- **Supports:** align, color (background, link, text), typography (fontSize, lineHeight) +- **Supports:** align, anchor, color (background, link, text), typography (fontSize, lineHeight) - **Attributes:** month, year ## Categories List @@ -77,7 +77,7 @@ Display a list of all categories. ([Source](https://github.com/WordPress/gutenbe - **Name:** core/categories - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, anchor, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayAsDropdown, showEmpty, showHierarchy, showOnlyTopLevel, showPostCounts ## Code @@ -113,7 +113,7 @@ This block is deprecated. Please use the Avatar block instead. ([Source](https:/ - **Name:** core/comment-author-avatar - **Category:** theme -- **Supports:** color (background, ~~text~~), spacing (margin, padding), ~~html~~, ~~inserter~~ +- **Supports:** anchor, color (background, ~~text~~), spacing (margin, padding), ~~html~~, ~~inserter~~ - **Attributes:** height, width ## Comment Author Name @@ -122,7 +122,7 @@ Displays the name of the author of the comment. ([Source](https://github.com/Wor - **Name:** core/comment-author-name - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, linkTarget, textAlign ## Comment Content @@ -131,7 +131,7 @@ Displays the contents of a comment. ([Source](https://github.com/WordPress/guten - **Name:** core/comment-content - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Comment Date @@ -140,7 +140,7 @@ Displays the date on which the comment was posted. ([Source](https://github.com/ - **Name:** core/comment-date - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** format, isLink ## Comment Edit Link @@ -149,7 +149,7 @@ Displays a link to edit the comment in the WordPress Dashboard. This link is onl - **Name:** core/comment-edit-link - **Category:** theme -- **Supports:** color (background, gradients, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** linkTarget, textAlign ## Comment Reply Link @@ -158,7 +158,7 @@ Displays a link to reply to a comment. ([Source](https://github.com/WordPress/gu - **Name:** core/comment-reply-link - **Category:** theme -- **Supports:** color (background, gradients, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Comment Template @@ -167,7 +167,7 @@ Contains the block elements used to display a comment, like the title, date, aut - **Name:** core/comment-template - **Category:** design -- **Supports:** align, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, anchor, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Comments @@ -176,7 +176,7 @@ An advanced block that allows displaying post comments using different visual co - **Name:** core/comments - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** legacy, tagName ## Comments Pagination @@ -185,7 +185,7 @@ Displays a paginated navigation to next/previous set of comments, when applicabl - **Name:** core/comments-pagination - **Category:** theme -- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, anchor, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** paginationArrow ## Comments Next Page @@ -194,7 +194,7 @@ Displays the next comment's page link. ([Source](https://github.com/WordPress/gu - **Name:** core/comments-pagination-next - **Category:** theme -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Comments Page Numbers @@ -203,7 +203,7 @@ Displays a list of page numbers for comments pagination. ([Source](https://githu - **Name:** core/comments-pagination-numbers - **Category:** theme -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Comments Previous Page @@ -212,7 +212,7 @@ Displays the previous comment's page link. ([Source](https://github.com/WordPres - **Name:** core/comments-pagination-previous - **Category:** theme -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Comments Title @@ -293,7 +293,7 @@ Create a link that always points to the homepage of the site. Usually not necess - **Name:** core/home-link - **Category:** design -- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Custom HTML @@ -320,7 +320,7 @@ Display a list of your most recent comments. ([Source](https://github.com/WordPr - **Name:** core/latest-comments - **Category:** widgets -- **Supports:** align, spacing (margin, padding), ~~html~~ +- **Supports:** align, anchor, spacing (margin, padding), ~~html~~ - **Attributes:** commentsToShow, displayAvatar, displayDate, displayExcerpt ## Latest Posts @@ -329,7 +329,7 @@ Display a list of your most recent posts. ([Source](https://github.com/WordPress - **Name:** core/latest-posts - **Category:** widgets -- **Supports:** align, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** addLinkToFeaturedImage, categories, columns, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postLayout, postsToShow, selectedAuthor ## List @@ -356,7 +356,7 @@ Show login & logout links. ([Source](https://github.com/WordPress/gutenberg/tree - **Name:** core/loginout - **Category:** theme -- **Supports:** className, typography (~~fontSize~~) +- **Supports:** anchor, className, typography (~~fontSize~~) - **Attributes:** displayLoginAsForm, redirectToCurrent ## Media & Text @@ -392,7 +392,7 @@ A collection of blocks that allow visitors to get around your site. ([Source](ht - **Name:** core/navigation - **Category:** theme -- **Supports:** align (full, wide), inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, hasIcon, icon, maxNestingLevel, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, templateLock, textColor ## Custom Link @@ -428,7 +428,7 @@ Display a list of all pages. ([Source](https://github.com/WordPress/gutenberg/tr - **Name:** core/page-list - **Category:** widgets -- **Supports:** typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** isNested, parentPageID ## Page List Item @@ -464,7 +464,7 @@ Display post author details such as name, avatar, and bio. ([Source](https://git - **Name:** core/post-author - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** avatarSize, byline, isLink, linkTarget, showAvatar, showBio, textAlign ## Post Author Biography @@ -473,7 +473,7 @@ The author biography. ([Source](https://github.com/WordPress/gutenberg/tree/trun - **Name:** core/post-author-biography - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** textAlign ## Post Author Name @@ -482,7 +482,7 @@ The author name. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/pac - **Name:** core/post-author-name - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, linkTarget, textAlign ## Post Comment (deprecated) @@ -500,7 +500,7 @@ Display a post's comments count. ([Source](https://github.com/WordPress/gutenber - **Name:** core/post-comments-count - **Category:** theme -- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Post Comments Form @@ -509,7 +509,7 @@ Display a post's comments form. ([Source](https://github.com/WordPress/gutenberg - **Name:** core/post-comments-form - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Post Comments Link @@ -518,7 +518,7 @@ Displays the link to the current post comments. ([Source](https://github.com/Wor - **Name:** core/post-comments-link - **Category:** theme -- **Supports:** color (background, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, link, ~~text~~), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Post Content @@ -527,7 +527,7 @@ Displays the contents of a post or page. ([Source](https://github.com/WordPress/ - **Name:** core/post-content - **Category:** theme -- **Supports:** align (full, wide), dimensions (minHeight), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, dimensions (minHeight), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** ## Post Date @@ -536,7 +536,7 @@ Add the date of this post. ([Source](https://github.com/WordPress/gutenberg/tree - **Name:** core/post-date - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** displayType, format, isLink, textAlign ## Post Excerpt @@ -545,7 +545,7 @@ Display a post's excerpt. ([Source](https://github.com/WordPress/gutenberg/tree/ - **Name:** core/post-excerpt - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** moreText, showMoreOnNewLine, textAlign ## Post Featured Image @@ -554,7 +554,7 @@ Display a post's featured image. ([Source](https://github.com/WordPress/gutenber - **Name:** core/post-featured-image - **Category:** theme -- **Supports:** align (center, full, left, right, wide), color (~~background~~, ~~text~~), spacing (margin, padding), ~~html~~ +- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), spacing (margin, padding), ~~html~~ - **Attributes:** customGradient, customOverlayColor, dimRatio, gradient, height, isLink, linkTarget, overlayColor, rel, scale, sizeSlug, width ## Post Navigation Link @@ -563,7 +563,7 @@ Displays the next or previous post link that is adjacent to the current post. ([ - **Name:** core/post-navigation-link - **Category:** theme -- **Supports:** color (background, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** arrow, label, linkLabel, showTitle, textAlign, type ## Post Template @@ -572,7 +572,7 @@ Contains the block elements used to render a post, like the title, date, feature - **Name:** core/post-template - **Category:** theme -- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, anchor, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Post Terms @@ -581,7 +581,7 @@ Post terms. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/packages - **Name:** core/post-terms - **Category:** theme -- **Supports:** color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** prefix, separator, suffix, term, textAlign ## Post Title @@ -590,7 +590,7 @@ Displays the title of a post, page, or any other content-type. ([Source](https:/ - **Name:** core/post-title - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, level, linkTarget, rel, textAlign ## Preformatted @@ -617,7 +617,7 @@ An advanced block that allows displaying post types based on different query par - **Name:** core/query - **Category:** theme -- **Supports:** align (full, wide), ~~html~~ +- **Supports:** align (full, wide), anchor, ~~html~~ - **Attributes:** displayLayout, namespace, query, queryId, tagName ## No results @@ -626,7 +626,7 @@ Contains the block elements used to render content when no query results are fou - **Name:** core/query-no-results - **Category:** theme -- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, anchor, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Pagination @@ -635,7 +635,7 @@ Displays a paginated navigation to next/previous set of posts, when applicable. - **Name:** core/query-pagination - **Category:** theme -- **Supports:** align, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** align, anchor, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** paginationArrow ## Next Page @@ -644,7 +644,7 @@ Displays the next posts page link. ([Source](https://github.com/WordPress/gutenb - **Name:** core/query-pagination-next - **Category:** theme -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Page Numbers @@ -653,7 +653,7 @@ Displays a list of page numbers for pagination ([Source](https://github.com/Word - **Name:** core/query-pagination-numbers - **Category:** theme -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** ## Previous Page @@ -662,7 +662,7 @@ Displays the previous posts page link. ([Source](https://github.com/WordPress/gu - **Name:** core/query-pagination-previous - **Category:** theme -- **Supports:** color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ +- **Supports:** anchor, color (background, gradients, ~~text~~), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~ - **Attributes:** label ## Query Title @@ -671,7 +671,7 @@ Display the query title. ([Source](https://github.com/WordPress/gutenberg/tree/t - **Name:** core/query-title - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** level, showPrefix, showSearchTerm, textAlign, type ## Quote @@ -689,7 +689,7 @@ Displays the link of a post, page, or any other content-type. ([Source](https:// - **Name:** core/read-more - **Category:** theme -- **Supports:** color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** content, linkTarget ## RSS @@ -698,7 +698,7 @@ Display entries from any RSS or Atom feed. ([Source](https://github.com/WordPres - **Name:** core/rss - **Category:** widgets -- **Supports:** align, ~~html~~ +- **Supports:** align, anchor, ~~html~~ - **Attributes:** blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow ## Search @@ -707,7 +707,7 @@ Help visitors find your content. ([Source](https://github.com/WordPress/gutenber - **Name:** core/search - **Category:** widgets -- **Supports:** align (center, left, right), color (background, gradients, text), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (center, left, right), anchor, color (background, gradients, text), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** buttonPosition, buttonText, buttonUseIcon, label, placeholder, query, showLabel, width, widthUnit ## Separator @@ -734,7 +734,7 @@ Display a graphic to represent this site. Update the block, and the changes appl - **Name:** core/site-logo - **Category:** theme -- **Supports:** align, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~ +- **Supports:** align, anchor, color (~~background~~, ~~text~~), spacing (margin, padding), ~~alignWide~~, ~~html~~ - **Attributes:** isLink, linkTarget, shouldSyncIcon, width ## Site Tagline @@ -743,7 +743,7 @@ Describe in a few words what the site is about. The tagline can be used in searc - **Name:** core/site-tagline - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Site Title @@ -752,7 +752,7 @@ Displays the name of this site. Update the block, and the changes apply everywhe - **Name:** core/site-title - **Category:** theme -- **Supports:** align (full, wide), color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** isLink, level, linkTarget, textAlign ## Social Icon @@ -761,7 +761,7 @@ Display an icon linking to a social media profile or site. ([Source](https://git - **Name:** core/social-link - **Category:** widgets -- **Supports:** ~~html~~, ~~reusable~~ +- **Supports:** anchor, ~~html~~, ~~reusable~~ - **Attributes:** label, rel, service, url ## Social Icons @@ -806,7 +806,7 @@ A cloud of your most used tags. ([Source](https://github.com/WordPress/gutenberg - **Name:** core/tag-cloud - **Category:** widgets -- **Supports:** align, spacing (margin, padding), typography (lineHeight), ~~html~~ +- **Supports:** align, anchor, spacing (margin, padding), typography (lineHeight), ~~html~~ - **Attributes:** largestFontSize, numberOfTags, showTagCounts, smallestFontSize, taxonomy ## Template Part @@ -815,7 +815,7 @@ Edit the different global regions of your site, like the header, footer, sidebar - **Name:** core/template-part - **Category:** theme -- **Supports:** align, ~~html~~, ~~reusable~~ +- **Supports:** align, anchor, ~~html~~, ~~reusable~~ - **Attributes:** area, slug, tagName, theme ## Term Description @@ -824,7 +824,7 @@ Display the description of categories, tags and custom taxonomies when viewing a - **Name:** core/term-description - **Category:** theme -- **Supports:** align (full, wide), color (background, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, color (background, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** textAlign ## Text Columns (deprecated) diff --git a/lib/block-supports/anchor.php b/lib/block-supports/anchor.php new file mode 100644 index 00000000000000..8f704a5019b365 --- /dev/null +++ b/lib/block-supports/anchor.php @@ -0,0 +1,67 @@ +supports, array( 'anchor' ), true ); + if ( ! $has_anchor_support ) { + return; + } + + if ( ! $block_type->attributes ) { + $block_type->attributes = array(); + } + + if ( ! array_key_exists( 'anchor', $block_type->attributes ) ) { + $block_type->attributes['anchor'] = array( + 'type' => 'string', + ); + } +} + +/** + * Add the anchor to the output. + * + * @param WP_Block_Type $block_type Block Type. + * @param array $block_attributes Block attributes. + * + * @return array Block anchor. + */ +function gutenberg_apply_anchor_support( $block_type, $block_attributes ) { + if ( ! $block_attributes ) { + return array(); + } + + if ( wp_should_skip_block_supports_serialization( $block_type, 'anchor' ) ) { + return array(); + } + + $has_anchor_support = _wp_array_get( $block_type->supports, array( 'anchor' ), true ); + if ( ! $has_anchor_support ) { + return array(); + } + + $has_anchor = array_key_exists( 'anchor', $block_attributes ); + if ( ! $has_anchor ) { + return array(); + } + + return array( 'id' => $block_attributes['anchor'] ); +} + +// Register the block support. +WP_Block_Supports::get_instance()->register( + 'anchor', + array( + 'register_attribute' => 'gutenberg_register_anchor_support', + 'apply' => 'gutenberg_apply_anchor_support', + ) +); diff --git a/lib/load.php b/lib/load.php index 9a5770e05c50d5..fb9da083390d43 100644 --- a/lib/load.php +++ b/lib/load.php @@ -141,4 +141,5 @@ function gutenberg_is_experiment_enabled( $name ) { require __DIR__ . '/block-supports/spacing.php'; require __DIR__ . '/block-supports/dimensions.php'; require __DIR__ . '/block-supports/duotone.php'; +require __DIR__ . '/block-supports/anchor.php'; require __DIR__ . '/block-supports/shadow.php'; diff --git a/packages/block-library/src/archives/block.json b/packages/block-library/src/archives/block.json index 3e589af452fa97..edc6895e14b06f 100644 --- a/packages/block-library/src/archives/block.json +++ b/packages/block-library/src/archives/block.json @@ -26,6 +26,7 @@ }, "supports": { "align": true, + "anchor": true, "html": false, "spacing": { "margin": true, diff --git a/packages/block-library/src/avatar/block.json b/packages/block-library/src/avatar/block.json index 690ef358a0ca1e..3fbb6dd9221aec 100644 --- a/packages/block-library/src/avatar/block.json +++ b/packages/block-library/src/avatar/block.json @@ -25,6 +25,7 @@ }, "usesContext": [ "postType", "postId", "commentId" ], "supports": { + "anchor": true, "html": false, "align": true, "alignWide": false, diff --git a/packages/block-library/src/calendar/block.json b/packages/block-library/src/calendar/block.json index 2accd7142c7cc9..c772cf58411f06 100644 --- a/packages/block-library/src/calendar/block.json +++ b/packages/block-library/src/calendar/block.json @@ -17,6 +17,7 @@ }, "supports": { "align": true, + "anchor": true, "color": { "link": true, "__experimentalSkipSerialization": [ "text", "background" ], diff --git a/packages/block-library/src/categories/block.json b/packages/block-library/src/categories/block.json index adf28dc42b4f03..a90a527e35c451 100644 --- a/packages/block-library/src/categories/block.json +++ b/packages/block-library/src/categories/block.json @@ -30,6 +30,7 @@ }, "supports": { "align": true, + "anchor": true, "html": false, "spacing": { "margin": true, diff --git a/packages/block-library/src/comment-author-avatar/block.json b/packages/block-library/src/comment-author-avatar/block.json index e0351e2453d998..2b6cefd6db9983 100644 --- a/packages/block-library/src/comment-author-avatar/block.json +++ b/packages/block-library/src/comment-author-avatar/block.json @@ -20,6 +20,7 @@ }, "usesContext": [ "commentId" ], "supports": { + "anchor": true, "html": false, "inserter": false, "__experimentalBorder": { diff --git a/packages/block-library/src/comment-author-name/block.json b/packages/block-library/src/comment-author-name/block.json index 59300c317a6799..cfa036fa80e2d3 100644 --- a/packages/block-library/src/comment-author-name/block.json +++ b/packages/block-library/src/comment-author-name/block.json @@ -22,6 +22,7 @@ }, "usesContext": [ "commentId" ], "supports": { + "anchor": true, "html": false, "spacing": { "margin": true, diff --git a/packages/block-library/src/comment-content/block.json b/packages/block-library/src/comment-content/block.json index 0c28c25f330ca9..69917ccce6aeaf 100644 --- a/packages/block-library/src/comment-content/block.json +++ b/packages/block-library/src/comment-content/block.json @@ -14,6 +14,7 @@ } }, "supports": { + "anchor": true, "color": { "gradients": true, "link": true, diff --git a/packages/block-library/src/comment-date/block.json b/packages/block-library/src/comment-date/block.json index e90cb0b0d8c4dc..ea1e2633381392 100644 --- a/packages/block-library/src/comment-date/block.json +++ b/packages/block-library/src/comment-date/block.json @@ -18,6 +18,7 @@ }, "usesContext": [ "commentId" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/comment-edit-link/block.json b/packages/block-library/src/comment-edit-link/block.json index 14795c83e1c53d..e695ddc3801f77 100644 --- a/packages/block-library/src/comment-edit-link/block.json +++ b/packages/block-library/src/comment-edit-link/block.json @@ -18,6 +18,7 @@ } }, "supports": { + "anchor": true, "html": false, "color": { "link": true, diff --git a/packages/block-library/src/comment-reply-link/block.json b/packages/block-library/src/comment-reply-link/block.json index 9d4a1d8668acc9..7ed60f34f581f9 100644 --- a/packages/block-library/src/comment-reply-link/block.json +++ b/packages/block-library/src/comment-reply-link/block.json @@ -14,6 +14,7 @@ } }, "supports": { + "anchor": true, "color": { "gradients": true, "link": true, diff --git a/packages/block-library/src/comment-template/block.json b/packages/block-library/src/comment-template/block.json index 1c318a8c21311e..9d0eb98684f142 100644 --- a/packages/block-library/src/comment-template/block.json +++ b/packages/block-library/src/comment-template/block.json @@ -10,6 +10,7 @@ "usesContext": [ "postId" ], "supports": { "align": true, + "anchor": true, "html": false, "reusable": false, "spacing": { diff --git a/packages/block-library/src/comments-pagination-next/block.json b/packages/block-library/src/comments-pagination-next/block.json index 48da9495bff624..f0cee1a1cdbe68 100644 --- a/packages/block-library/src/comments-pagination-next/block.json +++ b/packages/block-library/src/comments-pagination-next/block.json @@ -14,6 +14,7 @@ }, "usesContext": [ "postId", "comments/paginationArrow" ], "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/comments-pagination-numbers/block.json b/packages/block-library/src/comments-pagination-numbers/block.json index 479872bccf1408..0ab4f965ff1cd6 100644 --- a/packages/block-library/src/comments-pagination-numbers/block.json +++ b/packages/block-library/src/comments-pagination-numbers/block.json @@ -9,6 +9,7 @@ "textdomain": "default", "usesContext": [ "postId" ], "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/comments-pagination-previous/block.json b/packages/block-library/src/comments-pagination-previous/block.json index a48782af297606..211e1a33305a0d 100644 --- a/packages/block-library/src/comments-pagination-previous/block.json +++ b/packages/block-library/src/comments-pagination-previous/block.json @@ -14,6 +14,7 @@ }, "usesContext": [ "postId", "comments/paginationArrow" ], "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/comments-pagination/block.json b/packages/block-library/src/comments-pagination/block.json index ffa2828912f26b..d7c8be4b8eaa25 100644 --- a/packages/block-library/src/comments-pagination/block.json +++ b/packages/block-library/src/comments-pagination/block.json @@ -17,6 +17,7 @@ "comments/paginationArrow": "paginationArrow" }, "supports": { + "anchor": true, "align": true, "reusable": false, "html": false, diff --git a/packages/block-library/src/comments/block.json b/packages/block-library/src/comments/block.json index 399941891d01aa..19490f6e99eb47 100644 --- a/packages/block-library/src/comments/block.json +++ b/packages/block-library/src/comments/block.json @@ -18,6 +18,8 @@ }, "supports": { "align": [ "wide", "full" ], + "anchor": true, + "html": false, "color": { "gradients": true, "link": true, @@ -27,7 +29,6 @@ "link": true } }, - "html": false, "spacing": { "margin": true, "padding": true diff --git a/packages/block-library/src/home-link/block.json b/packages/block-library/src/home-link/block.json index 567bdf8c27ba7b..df964ad76bc68d 100644 --- a/packages/block-library/src/home-link/block.json +++ b/packages/block-library/src/home-link/block.json @@ -22,6 +22,7 @@ "style" ], "supports": { + "anchor": true, "reusable": false, "html": false, "typography": { diff --git a/packages/block-library/src/latest-comments/block.json b/packages/block-library/src/latest-comments/block.json index 0b1ae021b52bc2..b7ba5c71a68321 100644 --- a/packages/block-library/src/latest-comments/block.json +++ b/packages/block-library/src/latest-comments/block.json @@ -29,6 +29,7 @@ }, "supports": { "align": true, + "anchor": true, "html": false, "spacing": { "margin": true, diff --git a/packages/block-library/src/latest-posts/block.json b/packages/block-library/src/latest-posts/block.json index 13a01280c4d1d2..9b451f5875c733 100644 --- a/packages/block-library/src/latest-posts/block.json +++ b/packages/block-library/src/latest-posts/block.json @@ -84,6 +84,7 @@ }, "supports": { "align": true, + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/loginout/block.json b/packages/block-library/src/loginout/block.json index 3db9d0040ce5fa..aea0bb9e688407 100644 --- a/packages/block-library/src/loginout/block.json +++ b/packages/block-library/src/loginout/block.json @@ -18,6 +18,7 @@ } }, "supports": { + "anchor": true, "className": true, "typography": { "fontSize": false diff --git a/packages/block-library/src/navigation/block.json b/packages/block-library/src/navigation/block.json index ee673816201492..16b0e57505c69d 100644 --- a/packages/block-library/src/navigation/block.json +++ b/packages/block-library/src/navigation/block.json @@ -92,6 +92,7 @@ }, "supports": { "align": [ "wide", "full" ], + "anchor": true, "html": false, "inserter": true, "typography": { diff --git a/packages/block-library/src/page-list/block.json b/packages/block-library/src/page-list/block.json index 4f4f45c4bb4748..0fa309431202a9 100644 --- a/packages/block-library/src/page-list/block.json +++ b/packages/block-library/src/page-list/block.json @@ -33,6 +33,7 @@ "openSubmenusOnClick" ], "supports": { + "anchor": true, "reusable": false, "html": false, "typography": { diff --git a/packages/block-library/src/post-author-biography/block.json b/packages/block-library/src/post-author-biography/block.json index 434b6b0965880c..a2e5f327acfeb7 100644 --- a/packages/block-library/src/post-author-biography/block.json +++ b/packages/block-library/src/post-author-biography/block.json @@ -13,6 +13,7 @@ }, "usesContext": [ "postType", "postId" ], "supports": { + "anchor": true, "spacing": { "margin": true, "padding": true diff --git a/packages/block-library/src/post-author-name/block.json b/packages/block-library/src/post-author-name/block.json index 29ad4b0d4deb27..2340636e0c63a4 100644 --- a/packages/block-library/src/post-author-name/block.json +++ b/packages/block-library/src/post-author-name/block.json @@ -21,6 +21,7 @@ }, "usesContext": [ "postType", "postId" ], "supports": { + "anchor": true, "html": false, "spacing": { "margin": true, diff --git a/packages/block-library/src/post-author/block.json b/packages/block-library/src/post-author/block.json index 7d7cd28225bc8c..bb9f69ade07e6e 100644 --- a/packages/block-library/src/post-author/block.json +++ b/packages/block-library/src/post-author/block.json @@ -35,6 +35,7 @@ }, "usesContext": [ "postType", "postId", "queryId" ], "supports": { + "anchor": true, "html": false, "spacing": { "margin": true, diff --git a/packages/block-library/src/post-comments-count/block.json b/packages/block-library/src/post-comments-count/block.json index a30920fbbee3ee..c56039a1fbee04 100644 --- a/packages/block-library/src/post-comments-count/block.json +++ b/packages/block-library/src/post-comments-count/block.json @@ -14,6 +14,7 @@ }, "usesContext": [ "postId" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/post-comments-form/block.json b/packages/block-library/src/post-comments-form/block.json index 5ed4122d1147b2..793d14d74ba7ba 100644 --- a/packages/block-library/src/post-comments-form/block.json +++ b/packages/block-library/src/post-comments-form/block.json @@ -13,6 +13,7 @@ }, "usesContext": [ "postId", "postType" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/post-comments-link/block.json b/packages/block-library/src/post-comments-link/block.json index 29b4a2f8f54453..b0ff71adca1547 100644 --- a/packages/block-library/src/post-comments-link/block.json +++ b/packages/block-library/src/post-comments-link/block.json @@ -14,6 +14,7 @@ } }, "supports": { + "anchor": true, "html": false, "color": { "link": true, diff --git a/packages/block-library/src/post-content/block.json b/packages/block-library/src/post-content/block.json index c6041e036d132d..56834a980baed1 100644 --- a/packages/block-library/src/post-content/block.json +++ b/packages/block-library/src/post-content/block.json @@ -8,6 +8,7 @@ "textdomain": "default", "usesContext": [ "postId", "postType", "queryId" ], "supports": { + "anchor": true, "align": [ "wide", "full" ], "html": false, "__experimentalLayout": true, diff --git a/packages/block-library/src/post-date/block.json b/packages/block-library/src/post-date/block.json index b469dbe87d7e07..41c45a4a57e26e 100644 --- a/packages/block-library/src/post-date/block.json +++ b/packages/block-library/src/post-date/block.json @@ -24,6 +24,7 @@ }, "usesContext": [ "postId", "postType", "queryId" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/post-excerpt/block.json b/packages/block-library/src/post-excerpt/block.json index 03107ff900e068..223b4c68bde0e1 100644 --- a/packages/block-library/src/post-excerpt/block.json +++ b/packages/block-library/src/post-excerpt/block.json @@ -20,6 +20,7 @@ }, "usesContext": [ "postId", "postType", "queryId" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/post-featured-image/block.json b/packages/block-library/src/post-featured-image/block.json index 40f51cffa06e75..e6c8c3bfbbd3f9 100644 --- a/packages/block-library/src/post-featured-image/block.json +++ b/packages/block-library/src/post-featured-image/block.json @@ -53,6 +53,7 @@ "usesContext": [ "postId", "postType", "queryId" ], "supports": { "align": [ "left", "right", "center", "wide", "full" ], + "anchor": true, "color": { "__experimentalDuotone": "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before", "text": false, diff --git a/packages/block-library/src/post-navigation-link/block.json b/packages/block-library/src/post-navigation-link/block.json index 7b8d87fe26ad7a..2bdfa654798ee6 100644 --- a/packages/block-library/src/post-navigation-link/block.json +++ b/packages/block-library/src/post-navigation-link/block.json @@ -31,6 +31,7 @@ } }, "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/post-template/block.json b/packages/block-library/src/post-template/block.json index bc9910b47d1dc5..c0fc0d6ff8e7ea 100644 --- a/packages/block-library/src/post-template/block.json +++ b/packages/block-library/src/post-template/block.json @@ -19,6 +19,7 @@ "reusable": false, "html": false, "align": true, + "anchor": true, "__experimentalLayout": { "allowEditing": false }, diff --git a/packages/block-library/src/post-terms/block.json b/packages/block-library/src/post-terms/block.json index e14f96170ca88c..1633c7c01b82ca 100644 --- a/packages/block-library/src/post-terms/block.json +++ b/packages/block-library/src/post-terms/block.json @@ -28,6 +28,7 @@ }, "usesContext": [ "postId", "postType" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index 015896ff1bad01..4a56a6f37b7795 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -31,6 +31,7 @@ }, "supports": { "align": [ "wide", "full" ], + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/query-no-results/block.json b/packages/block-library/src/query-no-results/block.json index f042223f36aeca..789dcc8e66f605 100644 --- a/packages/block-library/src/query-no-results/block.json +++ b/packages/block-library/src/query-no-results/block.json @@ -9,6 +9,7 @@ "textdomain": "default", "usesContext": [ "queryId", "query" ], "supports": { + "anchor": true, "align": true, "reusable": false, "html": false, diff --git a/packages/block-library/src/query-pagination-next/block.json b/packages/block-library/src/query-pagination-next/block.json index ad87d05b5ed997..d4861519f149ee 100644 --- a/packages/block-library/src/query-pagination-next/block.json +++ b/packages/block-library/src/query-pagination-next/block.json @@ -14,6 +14,7 @@ }, "usesContext": [ "queryId", "query", "paginationArrow" ], "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/query-pagination-numbers/block.json b/packages/block-library/src/query-pagination-numbers/block.json index fd285965819616..a05faff5f1b52b 100644 --- a/packages/block-library/src/query-pagination-numbers/block.json +++ b/packages/block-library/src/query-pagination-numbers/block.json @@ -9,6 +9,7 @@ "textdomain": "default", "usesContext": [ "queryId", "query" ], "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/query-pagination-previous/block.json b/packages/block-library/src/query-pagination-previous/block.json index 484cefe6bbd824..823808b0fb054d 100644 --- a/packages/block-library/src/query-pagination-previous/block.json +++ b/packages/block-library/src/query-pagination-previous/block.json @@ -14,6 +14,7 @@ }, "usesContext": [ "queryId", "query", "paginationArrow" ], "supports": { + "anchor": true, "reusable": false, "html": false, "color": { diff --git a/packages/block-library/src/query-pagination/block.json b/packages/block-library/src/query-pagination/block.json index f75f4077d4e13d..fa980575ec969d 100644 --- a/packages/block-library/src/query-pagination/block.json +++ b/packages/block-library/src/query-pagination/block.json @@ -18,6 +18,7 @@ "paginationArrow": "paginationArrow" }, "supports": { + "anchor": true, "align": true, "reusable": false, "html": false, diff --git a/packages/block-library/src/query-title/block.json b/packages/block-library/src/query-title/block.json index 33df75866bce0a..029762c321e399 100644 --- a/packages/block-library/src/query-title/block.json +++ b/packages/block-library/src/query-title/block.json @@ -27,6 +27,7 @@ } }, "supports": { + "anchor": true, "align": [ "wide", "full" ], "html": false, "color": { diff --git a/packages/block-library/src/query/block.json b/packages/block-library/src/query/block.json index 1974761962ec91..bcff0e3ac63b17 100644 --- a/packages/block-library/src/query/block.json +++ b/packages/block-library/src/query/block.json @@ -49,6 +49,7 @@ }, "supports": { "align": [ "wide", "full" ], + "anchor": true, "html": false, "__experimentalLayout": true }, diff --git a/packages/block-library/src/read-more/block.json b/packages/block-library/src/read-more/block.json index 61b0452c7c80e6..ed2b23c3b7f0fd 100644 --- a/packages/block-library/src/read-more/block.json +++ b/packages/block-library/src/read-more/block.json @@ -17,6 +17,7 @@ }, "usesContext": [ "postId" ], "supports": { + "anchor": true, "html": false, "color": { "gradients": true, diff --git a/packages/block-library/src/rss/block.json b/packages/block-library/src/rss/block.json index 8a351d877a751d..2e3fd4b2d385e1 100644 --- a/packages/block-library/src/rss/block.json +++ b/packages/block-library/src/rss/block.json @@ -43,6 +43,7 @@ }, "supports": { "align": true, + "anchor": true, "html": false }, "editorStyle": "wp-block-rss-editor", diff --git a/packages/block-library/src/search/block.json b/packages/block-library/src/search/block.json index fbd0fa874c4087..387295ebb36dea 100644 --- a/packages/block-library/src/search/block.json +++ b/packages/block-library/src/search/block.json @@ -46,6 +46,7 @@ }, "supports": { "align": [ "left", "center", "right" ], + "anchor": true, "color": { "gradients": true, "__experimentalSkipSerialization": true, diff --git a/packages/block-library/src/site-logo/block.json b/packages/block-library/src/site-logo/block.json index f7efcb72159ff0..f5eab1de304bc2 100644 --- a/packages/block-library/src/site-logo/block.json +++ b/packages/block-library/src/site-logo/block.json @@ -31,6 +31,7 @@ }, "supports": { "html": false, + "anchor": true, "align": true, "alignWide": false, "color": { diff --git a/packages/block-library/src/site-tagline/block.json b/packages/block-library/src/site-tagline/block.json index ba477290a53df9..c7da7ebf3fddeb 100644 --- a/packages/block-library/src/site-tagline/block.json +++ b/packages/block-library/src/site-tagline/block.json @@ -13,6 +13,7 @@ } }, "supports": { + "anchor": true, "align": [ "wide", "full" ], "html": false, "color": { diff --git a/packages/block-library/src/site-title/block.json b/packages/block-library/src/site-title/block.json index aeac5ee57462f3..b69acda934fda2 100644 --- a/packages/block-library/src/site-title/block.json +++ b/packages/block-library/src/site-title/block.json @@ -27,6 +27,7 @@ "viewportWidth": 500 }, "supports": { + "anchor": true, "align": [ "wide", "full" ], "html": false, "color": { diff --git a/packages/block-library/src/social-link/block.json b/packages/block-library/src/social-link/block.json index 5f64b7dcf777c5..e81894591b4b33 100644 --- a/packages/block-library/src/social-link/block.json +++ b/packages/block-library/src/social-link/block.json @@ -28,6 +28,7 @@ "iconBackgroundColorValue" ], "supports": { + "anchor": true, "reusable": false, "html": false }, diff --git a/packages/block-library/src/tag-cloud/block.json b/packages/block-library/src/tag-cloud/block.json index c722227398603f..ec1e3335127193 100644 --- a/packages/block-library/src/tag-cloud/block.json +++ b/packages/block-library/src/tag-cloud/block.json @@ -36,6 +36,7 @@ ], "supports": { "html": false, + "anchor": true, "align": true, "spacing": { "margin": true, diff --git a/packages/block-library/src/template-part/block.json b/packages/block-library/src/template-part/block.json index 3801eee941bc99..282ac2ca22127a 100644 --- a/packages/block-library/src/template-part/block.json +++ b/packages/block-library/src/template-part/block.json @@ -21,6 +21,7 @@ } }, "supports": { + "anchor": true, "align": true, "html": false, "reusable": false diff --git a/packages/block-library/src/term-description/block.json b/packages/block-library/src/term-description/block.json index 66eb9348a47093..5e945b2d0f6374 100644 --- a/packages/block-library/src/term-description/block.json +++ b/packages/block-library/src/term-description/block.json @@ -12,6 +12,7 @@ } }, "supports": { + "anchor": true, "align": [ "wide", "full" ], "html": false, "color": {