From d6cff7965a10c89e629a87eb6e4ecb0ed9614d50 Mon Sep 17 00:00:00 2001
From: youknowriad
Date: Tue, 20 Oct 2020 13:36:16 +0000
Subject: [PATCH] Block Editor: Update the WordPress Packages to the latest
version.
This includes the packages that match the Gutenberg 9.2 Release.
It is going to be the last block-editor features update for WordPress 5.6.
It also updates the block-supports code base to the latest APIs.
Props isabel_brison, noisysocks, desrosj.
Fixes #51570.
Built from https://develop.svn.wordpress.org/trunk@49226
git-svn-id: http://core.svn.wordpress.org/trunk@48988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-includes/assets/script-loader-packages.php | 2 +-
wp-includes/block-supports/align.php | 21 +-
wp-includes/block-supports/colors.php | 56 +-
.../block-supports/custom-classname.php | 21 +-
.../block-supports/generated-classname.php | 20 +-
wp-includes/block-supports/index.php | 137 -
wp-includes/block-supports/typography.php | 75 +-
wp-includes/blocks.php | 22 +-
wp-includes/blocks/archives.php | 6 +-
wp-includes/blocks/archives/block.json | 1 +
wp-includes/blocks/audio/block.json | 4 +-
wp-includes/blocks/block/block.json | 1 +
wp-includes/blocks/button/block.json | 3 +-
wp-includes/blocks/buttons/block.json | 4 +-
wp-includes/blocks/calendar.php | 6 +-
wp-includes/blocks/calendar/block.json | 1 +
wp-includes/blocks/categories.php | 8 +-
wp-includes/blocks/categories/block.json | 1 +
wp-includes/blocks/classic/block.json | 1 +
wp-includes/blocks/code/block.json | 4 +-
wp-includes/blocks/column/block.json | 11 +-
wp-includes/blocks/columns/block.json | 6 +-
wp-includes/blocks/embed/block.json | 1 +
wp-includes/blocks/file/block.json | 1 +
wp-includes/blocks/group/block.json | 13 +-
wp-includes/blocks/heading/block.json | 11 +-
wp-includes/blocks/html/block.json | 1 +
wp-includes/blocks/image/block.json | 4 +-
wp-includes/blocks/latest-comments.php | 10 +-
wp-includes/blocks/latest-comments/block.json | 1 +
wp-includes/blocks/latest-posts.php | 6 +-
wp-includes/blocks/list/block.json | 6 +-
wp-includes/blocks/media-text/block.json | 6 +-
wp-includes/blocks/missing/block.json | 1 +
wp-includes/blocks/more/block.json | 1 +
wp-includes/blocks/nextpage/block.json | 1 +
wp-includes/blocks/paragraph/block.json | 10 +-
wp-includes/blocks/preformatted/block.json | 4 +-
wp-includes/blocks/pullquote/block.json | 1 +
wp-includes/blocks/quote/block.json | 4 +-
wp-includes/blocks/rss.php | 3 +-
wp-includes/blocks/rss/block.json | 1 +
wp-includes/blocks/search.php | 13 +-
wp-includes/blocks/search/block.json | 8 +-
wp-includes/blocks/separator/block.json | 4 +-
wp-includes/blocks/shortcode/block.json | 1 +
wp-includes/blocks/social-link.php | 6 +-
wp-includes/blocks/social-link/block.json | 4 +-
wp-includes/blocks/social-links/block.json | 2 +-
wp-includes/blocks/spacer/block.json | 1 +
wp-includes/blocks/subhead/block.json | 1 +
wp-includes/blocks/table/block.json | 4 +-
wp-includes/blocks/tag-cloud.php | 5 +-
wp-includes/blocks/tag-cloud/block.json | 1 +
wp-includes/blocks/text-columns/block.json | 1 +
wp-includes/blocks/verse/block.json | 4 +-
wp-includes/blocks/video/block.json | 11 +-
wp-includes/class-wp-block-supports.php | 211 +
wp-includes/class-wp-block.php | 13 +-
.../css/dist/block-editor/style-rtl.css | 450 +-
.../css/dist/block-editor/style-rtl.min.css | 2 +-
wp-includes/css/dist/block-editor/style.css | 450 +-
.../css/dist/block-editor/style.min.css | 4 +-
.../css/dist/block-library/editor-rtl.css | 185 +-
.../css/dist/block-library/editor-rtl.min.css | 2 +-
wp-includes/css/dist/block-library/editor.css | 185 +-
.../css/dist/block-library/editor.min.css | 2 +-
.../css/dist/block-library/style-rtl.css | 169 +-
.../css/dist/block-library/style-rtl.min.css | 2 +-
wp-includes/css/dist/block-library/style.css | 169 +-
.../css/dist/block-library/style.min.css | 4 +-
wp-includes/css/dist/components/style-rtl.css | 119 +-
.../css/dist/components/style-rtl.min.css | 2 +-
wp-includes/css/dist/components/style.css | 119 +-
wp-includes/css/dist/components/style.min.css | 6 +-
wp-includes/css/dist/edit-post/style-rtl.css | 176 +-
.../css/dist/edit-post/style-rtl.min.css | 2 +-
wp-includes/css/dist/edit-post/style.css | 176 +-
wp-includes/css/dist/edit-post/style.min.css | 2 +-
.../css/dist/editor/editor-styles-rtl.css | 28 +-
.../css/dist/editor/editor-styles-rtl.min.css | 2 +-
wp-includes/css/dist/editor/editor-styles.css | 28 +-
.../css/dist/editor/editor-styles.min.css | 2 +-
wp-includes/css/dist/editor/style-rtl.css | 14 +-
wp-includes/css/dist/editor/style-rtl.min.css | 2 +-
wp-includes/css/dist/editor/style.css | 14 +-
wp-includes/css/dist/editor/style.min.css | 2 +-
wp-includes/default-filters.php | 1 +
wp-includes/js/dist/a11y.js | 8 +-
wp-includes/js/dist/a11y.min.js | 2 +-
wp-includes/js/dist/annotations.js | 16 +-
wp-includes/js/dist/annotations.min.js | 2 +-
wp-includes/js/dist/api-fetch.js | 100 +-
wp-includes/js/dist/api-fetch.min.js | 2 +-
wp-includes/js/dist/autop.js | 4 +-
wp-includes/js/dist/autop.min.js | 2 +-
wp-includes/js/dist/blob.js | 20 +-
wp-includes/js/dist/blob.min.js | 2 +-
wp-includes/js/dist/block-directory.js | 268 +-
wp-includes/js/dist/block-directory.min.js | 2 +-
wp-includes/js/dist/block-editor.js | 1900 ++---
wp-includes/js/dist/block-editor.min.js | 6 +-
wp-includes/js/dist/block-library.js | 6442 ++++++++---------
wp-includes/js/dist/block-library.min.js | 10 +-
.../block-serialization-default-parser.js | 4 +-
.../block-serialization-default-parser.min.js | 2 +-
wp-includes/js/dist/blocks.js | 266 +-
wp-includes/js/dist/blocks.min.js | 4 +-
wp-includes/js/dist/components.js | 3779 +++++-----
wp-includes/js/dist/components.min.js | 8 +-
wp-includes/js/dist/compose.js | 204 +-
wp-includes/js/dist/compose.min.js | 4 +-
wp-includes/js/dist/core-data.js | 76 +-
wp-includes/js/dist/core-data.min.js | 2 +-
wp-includes/js/dist/data-controls.js | 261 +-
wp-includes/js/dist/data-controls.min.js | 2 +-
wp-includes/js/dist/data.js | 611 +-
wp-includes/js/dist/data.min.js | 2 +-
wp-includes/js/dist/date.js | 22 +-
wp-includes/js/dist/date.min.js | 6 +-
wp-includes/js/dist/deprecated.js | 4 +-
wp-includes/js/dist/deprecated.min.js | 2 +-
wp-includes/js/dist/dom-ready.js | 4 +-
wp-includes/js/dist/dom-ready.min.js | 2 +-
wp-includes/js/dist/dom.js | 4 +-
wp-includes/js/dist/dom.min.js | 2 +-
wp-includes/js/dist/edit-post.js | 761 +-
wp-includes/js/dist/edit-post.min.js | 4 +-
wp-includes/js/dist/editor.js | 4682 +++++-------
wp-includes/js/dist/editor.min.js | 6 +-
wp-includes/js/dist/element.js | 12 +-
wp-includes/js/dist/element.min.js | 2 +-
wp-includes/js/dist/escape-html.js | 4 +-
wp-includes/js/dist/escape-html.min.js | 2 +-
wp-includes/js/dist/format-library.js | 174 +-
wp-includes/js/dist/format-library.min.js | 2 +-
wp-includes/js/dist/hooks.js | 8 +-
wp-includes/js/dist/hooks.min.js | 2 +-
wp-includes/js/dist/html-entities.js | 4 +-
wp-includes/js/dist/html-entities.min.js | 2 +-
wp-includes/js/dist/i18n.js | 8 +-
wp-includes/js/dist/i18n.min.js | 2 +-
wp-includes/js/dist/is-shallow-equal.js | 12 +-
wp-includes/js/dist/is-shallow-equal.min.js | 2 +-
wp-includes/js/dist/keyboard-shortcuts.js | 16 +-
wp-includes/js/dist/keyboard-shortcuts.min.js | 2 +-
wp-includes/js/dist/keycodes.js | 8 +-
wp-includes/js/dist/keycodes.min.js | 2 +-
wp-includes/js/dist/list-reusable-blocks.js | 84 +-
.../js/dist/list-reusable-blocks.min.js | 2 +-
wp-includes/js/dist/media-utils.js | 116 +-
wp-includes/js/dist/media-utils.min.js | 2 +-
wp-includes/js/dist/notices.js | 8 +-
wp-includes/js/dist/notices.min.js | 2 +-
wp-includes/js/dist/nux.js | 20 +-
wp-includes/js/dist/nux.min.js | 2 +-
wp-includes/js/dist/plugins.js | 56 +-
wp-includes/js/dist/plugins.min.js | 2 +-
wp-includes/js/dist/primitives.js | 13 +-
wp-includes/js/dist/primitives.min.js | 2 +-
wp-includes/js/dist/priority-queue.js | 4 +-
wp-includes/js/dist/priority-queue.min.js | 2 +-
wp-includes/js/dist/redux-routine.js | 54 +-
wp-includes/js/dist/redux-routine.min.js | 2 +-
wp-includes/js/dist/reusable-blocks.js | 884 +++
wp-includes/js/dist/reusable-blocks.min.js | 2 +
wp-includes/js/dist/rich-text.js | 156 +-
wp-includes/js/dist/rich-text.min.js | 7 +-
wp-includes/js/dist/server-side-render.js | 62 +-
wp-includes/js/dist/server-side-render.min.js | 2 +-
wp-includes/js/dist/shortcode.js | 4 +-
wp-includes/js/dist/shortcode.min.js | 2 +-
wp-includes/js/dist/token-list.js | 48 +-
wp-includes/js/dist/token-list.min.js | 2 +-
wp-includes/js/dist/url.js | 28 +-
wp-includes/js/dist/url.min.js | 2 +-
wp-includes/js/dist/viewport.js | 4 +-
wp-includes/js/dist/viewport.min.js | 2 +-
wp-includes/js/dist/warning.js | 4 +-
wp-includes/js/dist/warning.min.js | 2 +-
wp-includes/js/dist/wordcount.js | 214 +-
wp-includes/js/dist/wordcount.min.js | 2 +-
wp-includes/version.php | 2 +-
wp-settings.php | 7 +-
184 files changed, 12625 insertions(+), 12062 deletions(-)
delete mode 100644 wp-includes/block-supports/index.php
create mode 100644 wp-includes/class-wp-block-supports.php
create mode 100644 wp-includes/js/dist/reusable-blocks.js
create mode 100644 wp-includes/js/dist/reusable-blocks.min.js
diff --git a/wp-includes/assets/script-loader-packages.php b/wp-includes/assets/script-loader-packages.php
index bcbc7cfcde..c9acc6700e 100644
--- a/wp-includes/assets/script-loader-packages.php
+++ b/wp-includes/assets/script-loader-packages.php
@@ -1 +1 @@
- array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'dc7ee381aff6a9dc3ad4cf2c9ca120b7'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '27155380a815188dd577492812951589'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '070b6ecb852dc55922d59eb13a63389c'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '1c7dffba3d995fbccc86b411aa5cc562'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '01833b47de938f0f8e85794557bc18c3'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => '24354d8553ddfbcbf461b57065fe0771'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '9ae821cc38d2f7ff7d6ca9a589b6fc36'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '8f2089e3053fa95dc345070ec7eb2ac4'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '977fd3dd81047b7e745ecfac846b263c'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => 'a77a2680e229cc69e8e426a83346f998'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '7427e0fb448bf552a7823b18c60929fb'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue'), 'version' => '64ab8597aec30a2cc5ead65bfe1608e7'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '695e210b1278a073277be30612b012ab'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '9bc8bd6eb4596eb3dd6d088aee3c650b'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill'), 'version' => '16df67879fd40c06d062009d705eae7e'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => 'e4df6fe4e75e764950f212c46ae11c6b'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '56955507424d4f29407ed209d1ffb277'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'dff9d26a46cbd6f46e2d4895ccb23c46'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd6291b37a9b4f1368d9444f5aeb8d78a'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '5985400224db41e89fc807c1feec5f98'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '5ce5c9cde413b48409ee5168cfa4937d'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '1ea7443c7ed64cad48b984f226b278ea'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '067f1a106c08a603bdb1a96c3fa196f1'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '44fb9984a420dec846b07658bb9ee111'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'a899efa38966fd49729dc1de80e394ec'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '765bf227a85016fff816aa3b28158b82'), 'i18n.js' => array('dependencies' => array('wp-polyfill'), 'version' => '947c3285333752cf16a7b22b01af1ce0'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '935962abdcbf9cb9fcc644c7da72b14e'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '8a9f8bdb2f352208c0583c5e9d7f9f64'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '5633b88a2f66da4cf68426d8c9ccbb3e'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '9dd575a5aef56788369426613e26a342'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '5ae039ac87f0079983e21a0dd33b212c'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => '653f8218a30cebf85619ca99eb33115d'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'da59059e91898057d9589da458c2b6b5'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '31b1e6878ecada5283e79f43cd4aa475'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'd2b0458b408f1299f9fcde6db10b1b71'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9f53ee3ebd8d9c9ee570e4368fe61952'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '52a66a11b096e9f964677ff1bedbba47'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => 'ca63fa8d70b2d06ee4e89c51e373ac81'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'f8b8a12701f5fcd0cbf36306afcd338c'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'adb76b9fb90e39f9c4e0fbc1c6b84a2d'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '35ec0396c3210102f96e0660bbd1d957'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5e4305728fb1ee90de4dd5acb95ccb1a'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '4469c293d800f4b1655e1127043abd39'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => '5d3e954781d75c81dfcced5cb1d04d96'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'f729e1a9cd1c6d92b514a4ad3f020624'));
\ No newline at end of file
+ array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'a7dc4c94ca05d79fe1926acd3be57f4f'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => '35785b35bbbf3c4a5e979ba733e4043c'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'c6d9f25f1de157546a0f81062ea2ac93'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7e5ea82c279cc0758ca567a01e229432'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9ee6dca7fc448e120c3452ade58163b5'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives'), 'version' => 'b98e73240099ffe30081af3ac4d55534'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => '77ad7098c5c1fadffab1e25fd092c188'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => '0ad76e3e460ed7ea8748a9dd3d220501'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '7b92d77a790023414a5002a1622853fb'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-shortcode'), 'version' => 'a9d91a848c8d7ecfbf9763af14e96e7c'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => 'c18e6ad614a17e689215751a7890020a'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'cfe93f0de5c7d6a661ec04f38fa041e5'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-blocks', 'wp-data', 'wp-data-controls', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => 'f184b156c783f1137f65064a60bef9bf'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => 'a2473f40010c4d566eb3a42192f647a0'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-polyfill'), 'version' => '71c8a675e946cb9ba2a5d5b7d6a2c993'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => '236d956f797e6baf94e5bb412df1620e'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '5480dd7574d6b15f781387ca82f38c98'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '658b42390dd73c64306c372f824bb538'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => '0673a12cd64681bf831177bdbbc8c17c'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '49211272938d4db22529c44039c9dae5'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-wordcount'), 'version' => '6b08d8c160639cf8f02bf71e08fb2f7d'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => 'ac1269eb3eb7c6c8191705bfc2031910'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b8bd7b8863ae9d136fdd9ee31e2e7402'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'fe3749d9d581ac84e5a1d510c55ed959'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b4d5f3ad41c327f5896429baf9266da9'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => '8e8652a4cc634a7a5b32f2d664c0e0cc'), 'i18n.js' => array('dependencies' => array('wp-polyfill'), 'version' => '74259306f29940dfc0d175b259792d2c'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e7be680b2f3d7a7149e5b8686fd3949b'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-keycodes', 'wp-polyfill'), 'version' => '1e85c18d6ef4e27b12213145e9e9679f'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => 'e886991b733ab6256b674d45b18e43ef'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '13150f9453afa9c4d4e4380f65be0de2'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '98fccf5949d023c28f3bd71045621f60'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => '7cae25e674c0dc3d1c4e8d42f89bd2e2'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '107217d4c19489a0d1f21e08526331c6'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => '8f249a8adc2954966031702a8b29f498'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => '4dba7bfcd17579030d4b93ea97a24db4'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => '59111ff6019a7401dba22121e795e543'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '9441cdf8abe5a0f364cc6a8345068058'), 'reusable-blocks.js' => array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '7675569cdeea817fb322bd60bb0532a2'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-keycodes', 'wp-polyfill'), 'version' => '4b38b5f9c11b52d85670239acb3fa0fc'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'd78510caa4ce58473139a15b782b67e9'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '760ef1dc15a1da975ce384ac38245584'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '9c3b2205ac79cc76094def2dd76a5cfa'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '76613c4e7c046883554d789ee1af3c7a'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '2046fe168e829732d56285e317e158dd'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e93e31a3954c2b1e23e96280b27d3715'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5808f9da0ba314c3e34b085ac6194a69'));
\ No newline at end of file
diff --git a/wp-includes/block-supports/align.php b/wp-includes/block-supports/align.php
index 52392c76ef..d81663d5c4 100644
--- a/wp-includes/block-supports/align.php
+++ b/wp-includes/block-supports/align.php
@@ -8,6 +8,8 @@
/**
* Registers the align block attribute for block types that support it.
*
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
*/
function wp_register_alignment_support( $block_type ) {
@@ -33,13 +35,15 @@ function wp_register_alignment_support( $block_type ) {
* Add CSS classes for block alignment to the incoming attributes array.
* This will be applied to the block markup in the front-end.
*
- * @param array $attributes Comprehensive list of attributes to be applied.
- * @param array $block_attributes Block attributes.
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
+ * @param array $block_attributes Block attributes.
*
* @return array Block alignment CSS classes and inline styles.
*/
-function wp_apply_alignment_support( $attributes, $block_attributes, $block_type ) {
+function wp_apply_alignment_support( $block_type, $block_attributes ) {
+ $attributes = array();
$has_align_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
$has_align_support = wp_array_get( $block_type->supports, array( 'align' ), false );
@@ -48,9 +52,18 @@ function wp_apply_alignment_support( $attributes, $block_attributes, $block_type
$has_block_alignment = array_key_exists( 'align', $block_attributes );
if ( $has_block_alignment ) {
- $attributes['css_classes'][] = sprintf( 'align%s', $block_attributes['align'] );
+ $attributes['class'] = sprintf( 'align%s', $block_attributes['align'] );
}
}
return $attributes;
}
+
+// Register the block support.
+WP_Block_Supports::get_instance()->register(
+ 'align',
+ array(
+ 'register_attribute' => 'wp_register_alignment_support',
+ 'apply' => 'wp_apply_alignment_support',
+ )
+);
diff --git a/wp-includes/block-supports/colors.php b/wp-includes/block-supports/colors.php
index 76c0d48b6a..71cbcec64b 100644
--- a/wp-includes/block-supports/colors.php
+++ b/wp-includes/block-supports/colors.php
@@ -8,6 +8,8 @@
/**
* Registers the style and colors block attributes for block types that support it.
*
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
*/
function wp_register_colors_support( $block_type ) {
@@ -53,18 +55,21 @@ function wp_register_colors_support( $block_type ) {
* Add CSS classes and inline styles for colors to the incoming attributes array.
* This will be applied to the block markup in the front-end.
*
- * @param array $attributes Comprehensive list of attributes to be applied.
- * @param array $block_attributes Block attributes.
+ * @access private
+ *
* @param WP_Block_Type $block_type Block type.
+* @param array $block_attributes Block attributes.
*
* @return array Colors CSS classes and inline styles.
*/
-function wp_apply_colors_support( $attributes, $block_attributes, $block_type ) {
+function wp_apply_colors_support( $block_type, $block_attributes ) {
$color_support = wp_array_get( $block_type->supports, array( '__experimentalColor' ), false );
$has_text_colors_support = true === $color_support || ( is_array( $color_support ) && wp_array_get( $color_support, array( 'text' ), true ) );
$has_background_colors_support = true === $color_support || ( is_array( $color_support ) && wp_array_get( $color_support, array( 'background' ), true ) );
$has_link_colors_support = wp_array_get( $color_support, array( 'linkColor' ), false );
$has_gradients_support = wp_array_get( $color_support, array( 'gradients' ), false );
+ $classes = array();
+ $styles = array();
// Text Colors.
// Check support for text colors.
@@ -74,13 +79,13 @@ function wp_apply_colors_support( $attributes, $block_attributes, $block_type )
// Apply required generic class.
if ( $has_custom_text_color || $has_named_text_color ) {
- $attributes['css_classes'][] = 'has-text-color';
+ $classes[] = 'has-text-color';
}
// Apply color class or inline style.
if ( $has_named_text_color ) {
- $attributes['css_classes'][] = sprintf( 'has-%s-color', $block_attributes['textColor'] );
+ $classes[] = sprintf( 'has-%s-color', $block_attributes['textColor'] );
} elseif ( $has_custom_text_color ) {
- $attributes['inline_styles'][] = sprintf( 'color: %s;', $block_attributes['style']['color']['text'] );
+ $styles[] = sprintf( 'color: %s;', $block_attributes['style']['color']['text'] );
}
}
@@ -89,15 +94,15 @@ function wp_apply_colors_support( $attributes, $block_attributes, $block_type )
$has_link_color = isset( $block_attributes['style']['color']['link'] );
// Apply required class and style.
if ( $has_link_color ) {
- $attributes['css_classes'][] = 'has-link-color';
+ $classes[] = 'has-link-color';
// If link is a named color.
if ( strpos( $block_attributes['style']['color']['link'], 'var:preset|color|' ) !== false ) {
// Get the name from the string and add proper styles.
- $index_to_splice = strrpos( $block_attributes['style']['color']['link'], '|' ) + 1;
- $link_color_name = substr( $block_attributes['style']['color']['link'], $index_to_splice );
- $attributes['inline_styles'][] = sprintf( '--wp--style--color--link:var(--wp--preset--color--%s);', $link_color_name );
+ $index_to_splice = strrpos( $block_attributes['style']['color']['link'], '|' ) + 1;
+ $link_color_name = substr( $block_attributes['style']['color']['link'], $index_to_splice );
+ $styles[] = sprintf( '--wp--style--color--link: var(--wp--preset--color--%s);', $link_color_name );
} else {
- $attributes['inline_styles'][] = sprintf( '--wp--style--color--link: %s;', $block_attributes['style']['color']['link'] );
+ $styles[] = sprintf( '--wp--style--color--link: %s;', $block_attributes['style']['color']['link'] );
}
}
}
@@ -109,13 +114,13 @@ function wp_apply_colors_support( $attributes, $block_attributes, $block_type )
// Apply required background class.
if ( $has_custom_background_color || $has_named_background_color ) {
- $attributes['css_classes'][] = 'has-background';
+ $classes[] = 'has-background';
}
// Apply background color classes or styles.
if ( $has_named_background_color ) {
- $attributes['css_classes'][] = sprintf( 'has-%s-background-color', $block_attributes['backgroundColor'] );
+ $classes[] = sprintf( 'has-%s-background-color', $block_attributes['backgroundColor'] );
} elseif ( $has_custom_background_color ) {
- $attributes['inline_styles'][] = sprintf( 'background-color: %s;', $block_attributes['style']['color']['background'] );
+ $styles[] = sprintf( 'background-color: %s;', $block_attributes['style']['color']['background'] );
}
}
@@ -125,15 +130,32 @@ function wp_apply_colors_support( $attributes, $block_attributes, $block_type )
$has_custom_gradient = isset( $block_attributes['style']['color']['gradient'] );
if ( $has_named_gradient || $has_custom_gradient ) {
- $attributes['css_classes'][] = 'has-background';
+ $classes[] = 'has-background';
}
// Apply required background class.
if ( $has_named_gradient ) {
- $attributes['css_classes'][] = sprintf( 'has-%s-gradient-background', $block_attributes['gradient'] );
+ $classes[] = sprintf( 'has-%s-gradient-background', $block_attributes['gradient'] );
} elseif ( $has_custom_gradient ) {
- $attributes['inline_styles'][] = sprintf( 'background: %s;', $block_attributes['style']['color']['gradient'] );
+ $styles[] = sprintf( 'background: %s;', $block_attributes['style']['color']['gradient'] );
}
}
+ $attributes = array();
+ if ( ! empty( $classes ) ) {
+ $attributes['class'] = implode( ' ', $classes );
+ }
+ if ( ! empty( $styles ) ) {
+ $attributes['style'] = implode( ' ', $styles );
+ }
+
return $attributes;
}
+
+// Register the block support.
+WP_Block_Supports::get_instance()->register(
+ 'colors',
+ array(
+ 'register_attribute' => 'wp_register_colors_support',
+ 'apply' => 'wp_apply_colors_support',
+ )
+);
diff --git a/wp-includes/block-supports/custom-classname.php b/wp-includes/block-supports/custom-classname.php
index 33d90e76fd..7d45738afa 100644
--- a/wp-includes/block-supports/custom-classname.php
+++ b/wp-includes/block-supports/custom-classname.php
@@ -8,6 +8,8 @@
/**
* Registers the custom classname block attribute for block types that support it.
*
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
*/
function wp_register_custom_classname_support( $block_type ) {
@@ -31,14 +33,16 @@ function wp_register_custom_classname_support( $block_type ) {
/**
* Add the custom classnames to the output.
*
- * @param array $attributes Comprehensive list of attributes to be applied.
- * @param array $block_attributes Block attributes.
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
+ * @param array $block_attributes Block attributes.
*
* @return array Block CSS classes and inline styles.
*/
-function wp_apply_custom_classname_support( $attributes, $block_attributes, $block_type ) {
+function wp_apply_custom_classname_support( $block_type, $block_attributes ) {
$has_custom_classname_support = true;
+ $attributes = array();
if ( property_exists( $block_type, 'supports' ) ) {
$has_custom_classname_support = wp_array_get( $block_type->supports, array( 'customClassName' ), true );
}
@@ -46,9 +50,18 @@ function wp_apply_custom_classname_support( $attributes, $block_attributes, $blo
$has_custom_classnames = array_key_exists( 'className', $block_attributes );
if ( $has_custom_classnames ) {
- $attributes['css_classes'][] = $block_attributes['className'];
+ $attributes['class'] = $block_attributes['className'];
}
}
return $attributes;
}
+
+// Register the block support.
+WP_Block_Supports::get_instance()->register(
+ 'custom-classname',
+ array(
+ 'register_attribute' => 'wp_register_custom_classname_support',
+ 'apply' => 'wp_apply_custom_classname_support',
+ )
+);
diff --git a/wp-includes/block-supports/generated-classname.php b/wp-includes/block-supports/generated-classname.php
index c510bb094b..5bb1a14ae7 100644
--- a/wp-includes/block-supports/generated-classname.php
+++ b/wp-includes/block-supports/generated-classname.php
@@ -8,6 +8,8 @@
/**
* Get the generated classname from a given block name.
*
+ * @access private
+ *
* @param string $block_name Block Name.
* @return string Generated classname.
*/
@@ -34,14 +36,16 @@ function wp_get_block_default_classname( $block_name ) {
/**
* Add the generated classnames to the output.
*
- * @param array $attributes Comprehensive list of attributes to be applied.
- * @param array $block_attributes Block attributes.
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
+ * @param array $block_attributes Block attributes.
*
* @return array Block CSS classes and inline styles.
*/
-function wp_apply_generated_classname_support( $attributes, $block_attributes, $block_type ) {
+function wp_apply_generated_classname_support( $block_type, $block_attributes ) {
$has_generated_classname_support = true;
+ $attributes = array();
if ( property_exists( $block_type, 'supports' ) ) {
$has_generated_classname_support = wp_array_get( $block_type->supports, array( 'className' ), true );
}
@@ -49,9 +53,17 @@ function wp_apply_generated_classname_support( $attributes, $block_attributes, $
$block_classname = wp_get_block_default_classname( $block_type->name );
if ( $block_classname ) {
- $attributes['css_classes'][] = $block_classname;
+ $attributes['class'] = $block_classname;
}
}
return $attributes;
}
+
+// Register the block support.
+WP_Block_Supports::get_instance()->register(
+ 'generated-classname',
+ array(
+ 'apply' => 'wp_apply_generated_classname_support',
+ )
+);
diff --git a/wp-includes/block-supports/index.php b/wp-includes/block-supports/index.php
deleted file mode 100644
index e66807c5b1..0000000000
--- a/wp-includes/block-supports/index.php
+++ /dev/null
@@ -1,137 +0,0 @@
-get_all_registered();
- // Ideally we need a hook to extend the block registration
- // instead of mutating the block type.
- foreach ( $registered_block_types as $block_type ) {
- wp_register_alignment_support( $block_type );
- wp_register_colors_support( $block_type );
- wp_register_typography_support( $block_type );
- wp_register_custom_classname_support( $block_type );
- }
-}
-
-add_action( 'init', 'wp_register_block_supports', 21 );
-
-/**
- * Filters the frontend output of blocks and apply the block support flags transformations.
- *
- * @param string $block_content rendered block content.
- * @param array $block block object.
- * @return string filtered block content.
- */
-function wp_apply_block_supports( $block_content, $block ) {
- if ( ! isset( $block['attrs'] ) ) {
- return $block_content;
- }
-
- $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
- // If no render_callback, assume styles have been previously handled.
- if ( ! $block_type || ! $block_type->render_callback ) {
- return $block_content;
- }
-
- $attributes = array();
- $attributes = wp_apply_generated_classname_support( $attributes, $block['attrs'], $block_type );
- $attributes = wp_apply_colors_support( $attributes, $block['attrs'], $block_type );
- $attributes = wp_apply_typography_support( $attributes, $block['attrs'], $block_type );
- $attributes = wp_apply_alignment_support( $attributes, $block['attrs'], $block_type );
- $attributes = wp_apply_custom_classname_support( $attributes, $block['attrs'], $block_type );
-
- if ( ! count( $attributes ) ) {
- return $block_content;
- }
-
- $dom = new DOMDocument( '1.0', 'utf-8' );
-
- // Suppress DOMDocument::loadHTML warnings from polluting the front-end.
- $previous = libxml_use_internal_errors( true );
-
- // We need to wrap the block in order to handle UTF-8 properly.
- $wrapped_block_html =
- ''
- . $block_content
- . '';
-
- $success = $dom->loadHTML( $wrapped_block_html, LIBXML_HTML_NODEFDTD | LIBXML_COMPACT );
-
- // Clear errors and reset the use_errors setting.
- libxml_clear_errors();
- libxml_use_internal_errors( $previous );
-
- if ( ! $success ) {
- return $block_content;
- }
-
- // Structure is like `
open/close tags. The open tag needs to be adjusted so we get inside the tag
- // and not the tag itself.
- $start = strpos( $full_html, '', 0 ) + strlen( '' );
- $end = strpos( $full_html, '', $start );
- return trim( substr( $full_html, $start, $end - $start ) );
-}
-add_filter( 'render_block', 'wp_apply_block_supports', 10, 2 );
-
-/**
- * Normalizes spacing in a string representing a CSS rule
- *
- * @example
- * 'color :red;' becomes 'color:red'
- *
- * @param string $css_rule_string CSS rule.
- * @return string Normalized CSS rule.
- */
-function wp_normalize_css_rule( $css_rule_string ) {
- return trim( implode( ': ', preg_split( '/\s*:\s*/', $css_rule_string, 2 ) ), ';' );
-}
diff --git a/wp-includes/block-supports/typography.php b/wp-includes/block-supports/typography.php
index d2dd4e74f7..3fbfd2f068 100644
--- a/wp-includes/block-supports/typography.php
+++ b/wp-includes/block-supports/typography.php
@@ -8,6 +8,8 @@
/**
* Registers the style and typography block attributes for block types that support it.
*
+ * @access private
+ *
* @param WP_Block_Type $block_type Block Type.
*/
function wp_register_typography_support( $block_type ) {
@@ -16,11 +18,6 @@ function wp_register_typography_support( $block_type ) {
$has_font_size_support = wp_array_get( $block_type->supports, array( '__experimentalFontSize' ), false );
}
- $has_font_style_support = false;
- if ( property_exists( $block_type, 'supports' ) ) {
- $has_font_style_support = wp_array_get( $block_type->supports, array( '__experimentalFontStyle' ), false );
- }
-
$has_line_height_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
$has_line_height_support = wp_array_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
@@ -30,7 +27,7 @@ function wp_register_typography_support( $block_type ) {
$block_type->attributes = array();
}
- if ( ( $has_font_size_support || $has_font_style_support || $has_line_height_support ) && ! array_key_exists( 'style', $block_type->attributes ) ) {
+ if ( ( $has_font_size_support || $has_line_height_support ) && ! array_key_exists( 'style', $block_type->attributes ) ) {
$block_type->attributes['style'] = array(
'type' => 'object',
);
@@ -47,26 +44,24 @@ function wp_register_typography_support( $block_type ) {
* Add CSS classes and inline styles for font sizes to the incoming attributes array.
* This will be applied to the block markup in the front-end.
*
- * @param array $attributes Comprehensive list of attributes to be applied.
- * @param array $block_attributes Block attributes.
+ * @access private
+ *
* @param WP_Block_Type $block_type Block type.
+ * @param array $block_attributes Block attributes.
*
* @return array Font size CSS classes and inline styles.
*/
-function wp_apply_typography_support( $attributes, $block_attributes, $block_type ) {
+function wp_apply_typography_support( $block_type, $block_attributes ) {
$has_font_size_support = false;
+ $classes = array();
+ $styles = array();
if ( property_exists( $block_type, 'supports' ) ) {
- $has_font_size_support = wp_array_get( $block_type->supports, array( '__experimentalFontSize' ), false );
- }
-
- $has_font_style_support = false;
- if ( property_exists( $block_type, 'supports' ) ) {
- $has_font_style_support = wp_array_get( $block_type->supports, array( '__experimentalFontStyle' ), false );
+ $has_font_size_support = wp_array_get( $block_type->supports, array( 'fontSize' ), false );
}
$has_line_height_support = false;
if ( property_exists( $block_type, 'supports' ) ) {
- $has_line_height_support = wp_array_get( $block_type->supports, array( '__experimentalLineHeight' ), false );
+ $has_line_height_support = wp_array_get( $block_type->supports, array( 'lineHeight' ), false );
}
// Font Size.
@@ -76,35 +71,9 @@ function wp_apply_typography_support( $attributes, $block_attributes, $block_typ
// Apply required class or style.
if ( $has_named_font_size ) {
- $attributes['css_classes'][] = sprintf( 'has-%s-font-size', $block_attributes['fontSize'] );
+ $classes[] = sprintf( 'has-%s-font-size', $block_attributes['fontSize'] );
} elseif ( $has_custom_font_size ) {
- $attributes['inline_styles'][] = sprintf( 'font-size: %spx;', $block_attributes['style']['typography']['fontSize'] );
- }
- }
-
- // Font Styles e.g. bold, italic, underline & strikethrough.
- if ( $has_font_style_support ) {
- $has_font_styles = isset( $block_attributes['style']['typography']['fontStyles'] );
-
- // Apply required CSS classes.
- if ( $has_font_styles ) {
- $attributes['css_classes'][] = 'has-font-style';
-
- // CSS class names chosen to be more explicit than generic `has--font-style`.
- $font_style_classes = array(
- 'bold' => 'has-bold-font-weight',
- 'italic' => 'has-italic-font-style',
- 'underline' => 'has-underline-text-decoration',
- 'strikethrough' => 'has-strikethrough-text-decoration',
- );
-
- $style_selections = $block_attributes['style']['typography']['fontStyles'];
-
- foreach ( $style_selections as $style => $turned_on ) {
- if ( $turned_on ) {
- $attributes['css_classes'][] = $font_style_classes[ $style ];
- }
- }
+ $styles[] = sprintf( 'font-size: %spx;', $block_attributes['style']['typography']['fontSize'] );
}
}
@@ -113,9 +82,25 @@ function wp_apply_typography_support( $attributes, $block_attributes, $block_typ
$has_line_height = isset( $block_attributes['style']['typography']['lineHeight'] );
// Add the style (no classes for line-height).
if ( $has_line_height ) {
- $attributes['inline_styles'][] = sprintf( 'line-height: %s;', $block_attributes['style']['typography']['lineHeight'] );
+ $styles[] = sprintf( 'line-height: %s;', $block_attributes['style']['typography']['lineHeight'] );
}
}
+ $attributes = array();
+ if ( ! empty( $classes ) ) {
+ $attributes['class'] = implode( ' ', $classes );
+ }
+ if ( ! empty( $styles ) ) {
+ $attributes['style'] = implode( ' ', $styles );
+ }
+
return $attributes;
}
+
+WP_Block_Supports::get_instance()->register(
+ 'typography',
+ array(
+ 'register_attribute' => 'wp_register_typography_support',
+ 'apply' => 'wp_apply_typography_support',
+ )
+);
diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php
index f6e023c67f..206e7d3991 100644
--- a/wp-includes/blocks.php
+++ b/wp-includes/blocks.php
@@ -647,19 +647,33 @@ function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
return $output;
}
+/**
+ * Block currently being parsed.
+ *
+ * @type array
+*/
+global $current_parsed_block;
+
+$current_parsed_block = array(
+ 'blockName' => null,
+ 'attributes' => null,
+);
+
/**
* Renders a single block into a HTML string.
*
* @since 5.0.0
*
- * @global WP_Post $post The post to edit.
- * @global WP_Query $wp_query WordPress Query object.
+ * @global array $current_parsed_block Block currently being parsed.
+ * @global WP_Post $post The post to edit.
+ * @global WP_Query $wp_query WordPress Query object.
+ * @global WP_Query $wp_query WordPress Query object.
*
* @param array $parsed_block A single parsed block object.
* @return string String of rendered HTML.
*/
function render_block( $parsed_block ) {
- global $post, $wp_query;
+ global $post, $wp_query, $current_parsed_block;
/**
* Allows render_block() to be short-circuited, by returning a non-null value.
@@ -674,6 +688,8 @@ function render_block( $parsed_block ) {
return $pre_render;
}
+ $current_parsed_block = $parsed_block;
+
$source_block = $parsed_block;
/**
diff --git a/wp-includes/blocks/archives.php b/wp-includes/blocks/archives.php
index 3b7b2d1d39..04e7e4957c 100644
--- a/wp-includes/blocks/archives.php
+++ b/wp-includes/blocks/archives.php
@@ -97,9 +97,11 @@ function render_block_core_archives( $attributes ) {
);
}
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );
+
return sprintf(
- '',
- $classnames,
+ '',
+ $wrapper_attributes,
$archives
);
}
diff --git a/wp-includes/blocks/archives/block.json b/wp-includes/blocks/archives/block.json
index 14a9451e1b..7be2a90e41 100644
--- a/wp-includes/blocks/archives/block.json
+++ b/wp-includes/blocks/archives/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/archives",
"category": "widgets",
"attributes": {
diff --git a/wp-includes/blocks/audio/block.json b/wp-includes/blocks/audio/block.json
index 30b165e51c..a077767932 100644
--- a/wp-includes/blocks/audio/block.json
+++ b/wp-includes/blocks/audio/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/audio",
"category": "media",
"attributes": {
@@ -37,7 +38,6 @@
},
"supports": {
"anchor": true,
- "align": true,
- "lightBlockWrapper": true
+ "align": true
}
}
diff --git a/wp-includes/blocks/block/block.json b/wp-includes/blocks/block/block.json
index c6a21217ae..97afcca2e5 100644
--- a/wp-includes/blocks/block/block.json
+++ b/wp-includes/blocks/block/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/block",
"category": "reusable",
"attributes": {
diff --git a/wp-includes/blocks/button/block.json b/wp-includes/blocks/button/block.json
index 4e44f9d876..b0cff94836 100644
--- a/wp-includes/blocks/button/block.json
+++ b/wp-includes/blocks/button/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/button",
"category": "design",
"parent": [
@@ -58,6 +59,6 @@
"align": true,
"alignWide": false,
"reusable": false,
- "lightBlockWrapper": true
+ "__experimentalSelector": ".wp-block-button > a"
}
}
diff --git a/wp-includes/blocks/buttons/block.json b/wp-includes/blocks/buttons/block.json
index ce5c22427a..a1e4c33c2e 100644
--- a/wp-includes/blocks/buttons/block.json
+++ b/wp-includes/blocks/buttons/block.json
@@ -1,10 +1,10 @@
{
+ "apiVersion": 2,
"name": "core/buttons",
"category": "design",
"supports": {
"anchor": true,
"align": true,
- "alignWide": false,
- "lightBlockWrapper": true
+ "alignWide": false
}
}
diff --git a/wp-includes/blocks/calendar.php b/wp-includes/blocks/calendar.php
index 41968b4099..6e0c52886a 100644
--- a/wp-includes/blocks/calendar.php
+++ b/wp-includes/blocks/calendar.php
@@ -31,8 +31,10 @@ function render_block_core_calendar( $attributes ) {
}
}
- $output = sprintf(
- '%1$s
',
+ $wrapper_attributes = get_block_wrapper_attributes();
+ $output = sprintf(
+ '%2$s
',
+ $wrapper_attributes,
get_calendar( true, false )
);
diff --git a/wp-includes/blocks/calendar/block.json b/wp-includes/blocks/calendar/block.json
index 698140a333..eb585dec70 100644
--- a/wp-includes/blocks/calendar/block.json
+++ b/wp-includes/blocks/calendar/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/calendar",
"category": "widgets",
"attributes": {
diff --git a/wp-includes/blocks/categories.php b/wp-includes/blocks/categories.php
index 7a42daccc5..c820b7bd76 100644
--- a/wp-includes/blocks/categories.php
+++ b/wp-includes/blocks/categories.php
@@ -28,7 +28,7 @@ function render_block_core_categories( $attributes ) {
$id = 'wp-block-categories-' . $block_id;
$args['id'] = $id;
$args['show_option_none'] = __( 'Select Category' );
- $wrapper_markup = '%2$s
';
+ $wrapper_markup = '%2$s
';
$items_markup = wp_dropdown_categories( $args );
$type = 'dropdown';
@@ -42,16 +42,16 @@ function render_block_core_categories( $attributes ) {
);
}
} else {
- $wrapper_markup = '';
+ $wrapper_markup = '';
$items_markup = wp_list_categories( $args );
$type = 'list';
}
- $class = "wp-block-categories-{$type}";
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => "wp-block-categories-{$type}" ) );
return sprintf(
$wrapper_markup,
- esc_attr( $class ),
+ $wrapper_attributes,
$items_markup
);
}
diff --git a/wp-includes/blocks/categories/block.json b/wp-includes/blocks/categories/block.json
index d4fee5e064..be8e9d1c21 100644
--- a/wp-includes/blocks/categories/block.json
+++ b/wp-includes/blocks/categories/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/categories",
"category": "widgets",
"attributes": {
diff --git a/wp-includes/blocks/classic/block.json b/wp-includes/blocks/classic/block.json
index 63d2c9f37e..0ee6ba171b 100644
--- a/wp-includes/blocks/classic/block.json
+++ b/wp-includes/blocks/classic/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/freeform",
"category": "text",
"attributes": {
diff --git a/wp-includes/blocks/code/block.json b/wp-includes/blocks/code/block.json
index 9b3916f146..d9f37ed061 100644
--- a/wp-includes/blocks/code/block.json
+++ b/wp-includes/blocks/code/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/code",
"category": "text",
"attributes": {
@@ -9,7 +10,6 @@
}
},
"supports": {
- "anchor": true,
- "lightBlockWrapper": true
+ "anchor": true
}
}
diff --git a/wp-includes/blocks/column/block.json b/wp-includes/blocks/column/block.json
index bc8d16aa96..02c2084dab 100644
--- a/wp-includes/blocks/column/block.json
+++ b/wp-includes/blocks/column/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/column",
"category": "text",
"parent": [
@@ -9,15 +10,15 @@
"type": "string"
},
"width": {
- "type": "number",
- "min": 0,
- "max": 100
+ "type": "string"
+ },
+ "templateLock": {
+ "type": "string"
}
},
"supports": {
"anchor": true,
"reusable": false,
- "html": false,
- "lightBlockWrapper": true
+ "html": false
}
}
diff --git a/wp-includes/blocks/columns/block.json b/wp-includes/blocks/columns/block.json
index 0a84a4a35d..0cc93b718a 100644
--- a/wp-includes/blocks/columns/block.json
+++ b/wp-includes/blocks/columns/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/columns",
"category": "design",
"attributes": {
@@ -13,10 +14,9 @@
"full"
],
"html": false,
- "lightBlockWrapper": true,
- "__experimentalColor": {
+ "color": {
"gradients": true,
- "linkColor": true
+ "link": true
}
}
}
diff --git a/wp-includes/blocks/embed/block.json b/wp-includes/blocks/embed/block.json
index 34d8838770..3f6531af57 100644
--- a/wp-includes/blocks/embed/block.json
+++ b/wp-includes/blocks/embed/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/embed",
"category": "embed",
"attributes": {
diff --git a/wp-includes/blocks/file/block.json b/wp-includes/blocks/file/block.json
index c19ba5f714..230942f76a 100644
--- a/wp-includes/blocks/file/block.json
+++ b/wp-includes/blocks/file/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/file",
"category": "media",
"attributes": {
diff --git a/wp-includes/blocks/group/block.json b/wp-includes/blocks/group/block.json
index a2d0cc083a..6014985192 100644
--- a/wp-includes/blocks/group/block.json
+++ b/wp-includes/blocks/group/block.json
@@ -1,10 +1,14 @@
{
+ "apiVersion": 2,
"name": "core/group",
"category": "design",
"attributes": {
"tagName": {
"type": "string",
"default": "div"
+ },
+ "templateLock": {
+ "type": "string"
}
},
"supports": {
@@ -14,11 +18,12 @@
],
"anchor": true,
"html": false,
- "lightBlockWrapper": true,
- "__experimentalColor": {
+ "color": {
"gradients": true,
- "linkColor": true
+ "link": true
},
- "__experimentalPadding": true
+ "spacing": {
+ "padding": true
+ }
}
}
diff --git a/wp-includes/blocks/heading/block.json b/wp-includes/blocks/heading/block.json
index fd03a4487e..e1dd4b78db 100644
--- a/wp-includes/blocks/heading/block.json
+++ b/wp-includes/blocks/heading/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/heading",
"category": "text",
"attributes": {
@@ -20,14 +21,14 @@
}
},
"supports": {
+ "align": [ "wide", "full" ],
"anchor": true,
"className": false,
- "lightBlockWrapper": true,
- "__experimentalColor": {
- "linkColor": true
+ "color": {
+ "link": true
},
- "__experimentalFontSize": true,
- "__experimentalLineHeight": true,
+ "fontSize": true,
+ "lineHeight": true,
"__experimentalSelector": {
"core/heading/h1": "h1",
"core/heading/h2": "h2",
diff --git a/wp-includes/blocks/html/block.json b/wp-includes/blocks/html/block.json
index b9624b4b3e..13aa611346 100644
--- a/wp-includes/blocks/html/block.json
+++ b/wp-includes/blocks/html/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/html",
"category": "widgets",
"attributes": {
diff --git a/wp-includes/blocks/image/block.json b/wp-includes/blocks/image/block.json
index 798210cbd5..ec80dc4c9e 100644
--- a/wp-includes/blocks/image/block.json
+++ b/wp-includes/blocks/image/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/image",
"category": "media",
"attributes": {
@@ -70,7 +71,6 @@
}
},
"supports": {
- "anchor": true,
- "lightBlockWrapper": true
+ "anchor": true
}
}
diff --git a/wp-includes/blocks/latest-comments.php b/wp-includes/blocks/latest-comments.php
index 448677066c..555a125c4a 100644
--- a/wp-includes/blocks/latest-comments.php
+++ b/wp-includes/blocks/latest-comments.php
@@ -129,15 +129,15 @@ function render_block_core_latest_comments( $attributes = array() ) {
if ( empty( $comments ) ) {
$classnames[] = 'no-comments';
}
- $class = esc_attr( implode( ' ', $classnames ) );
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) );
return ! empty( $comments ) ? sprintf(
- '%2$s
',
- $class,
+ '%2$s
',
+ $wrapper_attributes,
$list_items_markup
) : sprintf(
- '%2$s
',
- $class,
+ '%2$s
',
+ $wrapper_attributes,
__( 'No comments to show.' )
);
}
diff --git a/wp-includes/blocks/latest-comments/block.json b/wp-includes/blocks/latest-comments/block.json
index dd208ee726..8ad73394cd 100644
--- a/wp-includes/blocks/latest-comments/block.json
+++ b/wp-includes/blocks/latest-comments/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/latest-comments",
"category": "widgets",
"attributes": {
diff --git a/wp-includes/blocks/latest-posts.php b/wp-includes/blocks/latest-posts.php
index 8486b05b6b..a43646edd7 100644
--- a/wp-includes/blocks/latest-posts.php
+++ b/wp-includes/blocks/latest-posts.php
@@ -171,9 +171,11 @@ function render_block_core_latest_posts( $attributes ) {
$class .= ' has-author';
}
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) );
+
return sprintf(
- '',
- esc_attr( $class ),
+ '',
+ $wrapper_attributes,
$list_items_markup
);
}
diff --git a/wp-includes/blocks/list/block.json b/wp-includes/blocks/list/block.json
index 3fa10c51a1..848c017842 100644
--- a/wp-includes/blocks/list/block.json
+++ b/wp-includes/blocks/list/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/list",
"category": "text",
"attributes": {
@@ -27,10 +28,9 @@
"supports": {
"anchor": true,
"className": false,
- "__experimentalColor": {
+ "color": {
"gradients": true
},
- "__unstablePasteTextInline": true,
- "lightBlockWrapper": true
+ "__unstablePasteTextInline": true
}
}
diff --git a/wp-includes/blocks/media-text/block.json b/wp-includes/blocks/media-text/block.json
index 9911c4d35e..e88b1b1d1b 100644
--- a/wp-includes/blocks/media-text/block.json
+++ b/wp-includes/blocks/media-text/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/media-text",
"category": "media",
"attributes": {
@@ -84,10 +85,9 @@
"anchor": true,
"align": [ "wide", "full" ],
"html": false,
- "lightBlockWrapper": true,
- "__experimentalColor": {
+ "color": {
"gradients": true,
- "linkColor": true
+ "link": true
}
}
}
diff --git a/wp-includes/blocks/missing/block.json b/wp-includes/blocks/missing/block.json
index 57a246966d..f60bb8c9da 100644
--- a/wp-includes/blocks/missing/block.json
+++ b/wp-includes/blocks/missing/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/missing",
"category": "text",
"attributes": {
diff --git a/wp-includes/blocks/more/block.json b/wp-includes/blocks/more/block.json
index 7697b06ac4..4279443517 100644
--- a/wp-includes/blocks/more/block.json
+++ b/wp-includes/blocks/more/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/more",
"category": "design",
"attributes": {
diff --git a/wp-includes/blocks/nextpage/block.json b/wp-includes/blocks/nextpage/block.json
index ed9293b2a9..2236627dbb 100644
--- a/wp-includes/blocks/nextpage/block.json
+++ b/wp-includes/blocks/nextpage/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/nextpage",
"category": "design",
"parent": [ "core/post-content" ],
diff --git a/wp-includes/blocks/paragraph/block.json b/wp-includes/blocks/paragraph/block.json
index 91d8ad357f..44118c165c 100644
--- a/wp-includes/blocks/paragraph/block.json
+++ b/wp-includes/blocks/paragraph/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/paragraph",
"category": "text",
"attributes": {
@@ -29,12 +30,11 @@
"supports": {
"anchor": true,
"className": false,
- "lightBlockWrapper": true,
- "__experimentalColor": {
- "linkColor": true
+ "color": {
+ "link": true
},
- "__experimentalFontSize": true,
- "__experimentalLineHeight": true,
+ "fontSize": true,
+ "lineHeight": true,
"__experimentalSelector": "p",
"__unstablePasteTextInline": true
}
diff --git a/wp-includes/blocks/preformatted/block.json b/wp-includes/blocks/preformatted/block.json
index 4eb99004f7..d235d33ccf 100644
--- a/wp-includes/blocks/preformatted/block.json
+++ b/wp-includes/blocks/preformatted/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/preformatted",
"category": "text",
"attributes": {
@@ -11,7 +12,6 @@
}
},
"supports": {
- "anchor": true,
- "lightBlockWrapper": true
+ "anchor": true
}
}
diff --git a/wp-includes/blocks/pullquote/block.json b/wp-includes/blocks/pullquote/block.json
index 7591b123f8..fa49196bec 100644
--- a/wp-includes/blocks/pullquote/block.json
+++ b/wp-includes/blocks/pullquote/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/pullquote",
"category": "text",
"attributes": {
diff --git a/wp-includes/blocks/quote/block.json b/wp-includes/blocks/quote/block.json
index a03b93b0db..9de3a338c9 100644
--- a/wp-includes/blocks/quote/block.json
+++ b/wp-includes/blocks/quote/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/quote",
"category": "text",
"attributes": {
@@ -20,7 +21,6 @@
}
},
"supports": {
- "anchor": true,
- "lightBlockWrapper": true
+ "anchor": true
}
}
diff --git a/wp-includes/blocks/rss.php b/wp-includes/blocks/rss.php
index a3dbd0d431..b0a31bf2bb 100644
--- a/wp-includes/blocks/rss.php
+++ b/wp-includes/blocks/rss.php
@@ -87,8 +87,9 @@ function render_block_core_rss( $attributes ) {
if ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) {
$classnames[] = 'columns-' . $attributes['columns'];
}
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) );
- return sprintf( '', esc_attr( implode( ' ', $classnames ) ), $list_items );
+ return sprintf( '', $wrapper_attributes, $list_items );
}
/**
diff --git a/wp-includes/blocks/rss/block.json b/wp-includes/blocks/rss/block.json
index 88ad78c596..49555c41cb 100644
--- a/wp-includes/blocks/rss/block.json
+++ b/wp-includes/blocks/rss/block.json
@@ -1,4 +1,5 @@
{
+ "apiVersion": 2,
"name": "core/rss",
"category": "widgets",
"attributes": {
diff --git a/wp-includes/blocks/search.php b/wp-includes/blocks/search.php
index 08c8652839..36607188ff 100644
--- a/wp-includes/blocks/search.php
+++ b/wp-includes/blocks/search.php
@@ -65,20 +65,22 @@ function render_block_core_search( $attributes ) {
if ( $show_button ) {
$button_internal_markup = '';
+ $button_classes = '';
if ( ! $use_icon_button ) {
if ( ! empty( $attributes['buttonText'] ) ) {
$button_internal_markup = $attributes['buttonText'];
}
} else {
+ $button_classes .= 'has-icon';
$button_internal_markup =
- '