@wordpress/block-library 8.14.0 → 8.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/avatar/edit.js +1 -0
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/index.js +3 -0
- package/build/avatar/index.js.map +1 -1
- package/build/block/edit.js +2 -30
- package/build/block/edit.js.map +1 -1
- package/build/block/index.js +2 -1
- package/build/block/index.js.map +1 -1
- package/build/buttons/edit.js +2 -2
- package/build/buttons/edit.js.map +1 -1
- package/build/column/edit.native.js +1 -4
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -0
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/deprecated.js +4 -2
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/index.js +2 -1
- package/build/cover/index.js.map +1 -1
- package/build/embed/embed-placeholder.native.js +37 -13
- package/build/embed/embed-placeholder.native.js.map +1 -1
- package/build/file/index.js +1 -2
- package/build/file/index.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/file/view-interactivity.js +23 -0
- package/build/file/view-interactivity.js.map +1 -0
- package/build/file/view.js +1 -15
- package/build/file/view.js.map +1 -1
- package/build/footnotes/edit.js +31 -1
- package/build/footnotes/edit.js.map +1 -1
- package/build/footnotes/format.js +119 -23
- package/build/footnotes/format.js.map +1 -1
- package/build/footnotes/index.js +45 -4
- package/build/footnotes/index.js.map +1 -1
- package/build/gallery/edit.js +8 -6
- package/build/gallery/edit.js.map +1 -1
- package/build/image/deprecated.js +106 -2
- package/build/image/deprecated.js.map +1 -1
- package/build/image/image.js +2 -2
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +2 -1
- package/build/image/index.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +1 -0
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/edit.js +2 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/edit.js +4 -4
- package/build/list/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +10 -1
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/media-text/media-container.native.js +2 -1
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/missing/edit.native.js +7 -5
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/constants.js +10 -4
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/edit/index.js +16 -2
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +2 -2
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +4 -4
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -15
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/index.js +2 -3
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +33 -45
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view-interactivity.js +185 -0
- package/build/navigation/view-interactivity.js.map +1 -0
- package/build/navigation/view-modal.js +125 -0
- package/build/navigation/view-modal.js.map +1 -0
- package/build/navigation/view.js +71 -163
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +12 -7
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +2 -2
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/pattern/edit.js +28 -4
- package/build/pattern/edit.js.map +1 -1
- package/build/preformatted/index.js +4 -0
- package/build/preformatted/index.js.map +1 -1
- package/build/query-pagination/edit.js +1 -1
- package/build/query-pagination/edit.js.map +1 -1
- package/build/query-title/edit.js +43 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/quote/transforms.js +8 -0
- package/build/quote/transforms.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.js +4 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/search/view.js +166 -62
- package/build/search/view.js.map +1 -1
- package/build/site-logo/edit.js +1 -0
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-link/icons/index.js +13 -0
- package/build/social-link/icons/index.js.map +1 -1
- package/build/social-link/icons/threads.js +25 -0
- package/build/social-link/icons/threads.js.map +1 -0
- package/build/social-link/variations.js +7 -0
- package/build/social-link/variations.js.map +1 -1
- package/build/tag-cloud/edit.js +1 -0
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/import-controls.js +1 -1
- package/build/template-part/edit/import-controls.js.map +1 -1
- package/build/template-part/edit/index.js +1 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build-module/avatar/edit.js +1 -0
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/index.js +3 -0
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/block/edit.js +4 -29
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/index.js +2 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/buttons/edit.js +2 -2
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/column/edit.native.js +1 -4
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/deprecated.js +4 -2
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/index.js +2 -1
- package/build-module/cover/index.js.map +1 -1
- package/build-module/embed/embed-placeholder.native.js +37 -14
- package/build-module/embed/embed-placeholder.native.js.map +1 -1
- package/build-module/file/index.js +1 -2
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/file/view-interactivity.js +19 -0
- package/build-module/file/view-interactivity.js.map +1 -0
- package/build-module/file/view.js +2 -15
- package/build-module/file/view.js.map +1 -1
- package/build-module/footnotes/edit.js +29 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/footnotes/format.js +120 -25
- package/build-module/footnotes/format.js.map +1 -1
- package/build-module/footnotes/index.js +45 -4
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/gallery/edit.js +8 -6
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/image/deprecated.js +107 -3
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/image.js +2 -2
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +2 -1
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +3 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +1 -0
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/edit.js +4 -4
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +10 -1
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/media-text/media-container.native.js +2 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/missing/edit.native.js +8 -6
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/constants.js +8 -3
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/edit/index.js +17 -3
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +2 -2
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +4 -4
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +10 -14
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/index.js +2 -3
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +35 -47
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view-interactivity.js +182 -0
- package/build-module/navigation/view-interactivity.js.map +1 -0
- package/build-module/navigation/view-modal.js +120 -0
- package/build-module/navigation/view-modal.js.map +1 -0
- package/build-module/navigation/view.js +72 -163
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +12 -7
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +2 -2
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/pattern/edit.js +27 -4
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/preformatted/index.js +4 -0
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/query-pagination/edit.js +1 -1
- package/build-module/query-pagination/edit.js.map +1 -1
- package/build-module/query-title/edit.js +44 -3
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/quote/transforms.js +8 -0
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.js +4 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/search/view.js +166 -62
- package/build-module/search/view.js.map +1 -1
- package/build-module/site-logo/edit.js +1 -0
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-link/icons/index.js +1 -0
- package/build-module/social-link/icons/index.js.map +1 -1
- package/build-module/social-link/icons/threads.js +15 -0
- package/build-module/social-link/icons/threads.js.map +1 -0
- package/build-module/social-link/variations.js +8 -1
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/tag-cloud/edit.js +1 -0
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +2 -2
- package/build-module/template-part/edit/import-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-style/details/style-rtl.css +4 -2
- package/build-style/details/style.css +4 -2
- package/build-style/footnotes/style-rtl.css +4 -3
- package/build-style/footnotes/style.css +4 -3
- package/build-style/navigation/style-rtl.css +14 -2
- package/build-style/navigation/style.css +14 -2
- package/build-style/preformatted/style-rtl.css +2 -1
- package/build-style/preformatted/style.css +2 -1
- package/build-style/query-pagination/style-rtl.css +4 -2
- package/build-style/query-pagination/style.css +4 -2
- package/build-style/social-links/style-rtl.css +7 -0
- package/build-style/social-links/style.css +7 -0
- package/build-style/style-rtl.css +36 -10
- package/build-style/style.css +36 -10
- package/build-style/video/style-rtl.css +1 -0
- package/build-style/video/style.css +1 -0
- package/package.json +33 -32
- package/src/audio/test/__snapshots__/edit.native.js.snap +118 -33
- package/src/avatar/block.json +3 -0
- package/src/avatar/edit.js +1 -0
- package/src/block/block.json +2 -1
- package/src/block/edit.js +1 -39
- package/src/block/editor.native.scss +2 -2
- package/src/buttons/edit.js +2 -2
- package/src/buttons/test/edit.native.js +4 -0
- package/src/column/edit.native.js +4 -10
- package/src/column/editor.native.scss +0 -4
- package/src/columns/edit.js +1 -0
- package/src/columns/test/edit.native.js +5 -0
- package/src/comment-author-avatar/edit.js +1 -0
- package/src/comment-template/index.php +7 -2
- package/src/cover/block.json +2 -1
- package/src/cover/deprecated.js +2 -0
- package/src/cover/test/edit.native.js +8 -0
- package/src/embed/embed-placeholder.native.js +80 -47
- package/src/embed/styles.native.scss +54 -18
- package/src/embed/test/index.native.js +13 -5
- package/src/file/block.json +1 -2
- package/src/file/index.php +20 -2
- package/src/file/inspector.js +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +119 -33
- package/src/file/view-interactivity.js +18 -0
- package/src/file/view.js +5 -14
- package/src/footnotes/block.json +44 -2
- package/src/footnotes/edit.js +33 -2
- package/src/footnotes/format.js +90 -25
- package/src/footnotes/index.js +0 -1
- package/src/footnotes/index.php +207 -0
- package/src/footnotes/style.scss +6 -3
- package/src/gallery/edit.js +42 -38
- package/src/gallery/test/index.native.js +31 -18
- package/src/heading/test/index.native.js +4 -0
- package/src/home-link/index.php +15 -2
- package/src/image/block.json +2 -1
- package/src/image/deprecated.js +109 -3
- package/src/image/image.js +2 -2
- package/src/image/index.php +45 -8
- package/src/image/test/edit.native.js +1 -2
- package/src/index.js +5 -1
- package/src/latest-comments/edit.js +1 -0
- package/src/latest-posts/edit.js +2 -0
- package/src/list/edit.js +6 -4
- package/src/list/test/edit.native.js +134 -33
- package/src/list-item/hooks/use-merge.js +12 -5
- package/src/media-text/media-container.native.js +1 -0
- package/src/missing/edit.native.js +12 -10
- package/src/missing/style.native.scss +19 -12
- package/src/missing/test/__snapshots__/edit.native.js.snap +42 -13
- package/src/navigation/block.json +2 -3
- package/src/navigation/constants.js +12 -6
- package/src/navigation/edit/index.js +29 -1
- package/src/navigation/edit/inner-blocks.js +2 -2
- package/src/navigation/edit/menu-inspector-controls.js +1 -1
- package/src/navigation/edit/navigation-menu-selector.js +8 -4
- package/src/navigation/edit/unsaved-inner-blocks.js +2 -2
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +17 -21
- package/src/navigation/index.php +50 -18
- package/src/navigation/style.scss +27 -8
- package/src/navigation/use-navigation-menu.js +39 -63
- package/src/navigation/view-interactivity.js +196 -0
- package/src/navigation/view-modal.js +127 -0
- package/src/navigation/view.js +96 -185
- package/src/navigation-link/edit.js +61 -47
- package/src/navigation-submenu/edit.js +2 -2
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +1 -0
- package/src/paragraph/test/edit.native.js +81 -35
- package/src/pattern/edit.js +21 -0
- package/src/pattern/index.php +13 -1
- package/src/post-template/index.php +6 -2
- package/src/post-title/index.php +8 -3
- package/src/preformatted/block.json +4 -0
- package/src/preformatted/style.scss +4 -1
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -0
- package/src/pullquote/test/edit.native.js +12 -4
- package/src/query-pagination/edit.js +17 -14
- package/src/query-title/edit.js +48 -6
- package/src/quote/test/__snapshots__/transforms.native.js.snap +10 -0
- package/src/quote/test/edit.native.js +12 -4
- package/src/quote/test/transforms.native.js +5 -1
- package/src/quote/transforms.js +13 -0
- package/src/rss/edit.js +3 -0
- package/src/search/block.json +1 -0
- package/src/search/edit.js +4 -3
- package/src/search/index.php +26 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +70 -0
- package/src/search/view.js +171 -67
- package/src/site-logo/edit.js +1 -0
- package/src/social-link/icons/index.js +1 -0
- package/src/social-link/icons/threads.js +10 -0
- package/src/social-link/index.php +4 -0
- package/src/social-link/socials-with-bg.scss +5 -0
- package/src/social-link/socials-without-bg.scss +4 -0
- package/src/social-link/variations.js +7 -0
- package/src/tag-cloud/edit.js +1 -0
- package/src/template-part/edit/import-controls.js +2 -2
- package/src/template-part/edit/index.js +1 -1
- package/src/template-part/index.php +7 -16
- package/src/text-columns/edit.js +1 -0
- package/src/video/style.scss +1 -0
- package/build/gallery/shared-icon.native.js +0 -38
- package/build/gallery/shared-icon.native.js.map +0 -1
- package/build-module/gallery/shared-icon.native.js +0 -24
- package/build-module/gallery/shared-icon.native.js.map +0 -1
- package/src/gallery/shared-icon.native.js +0 -23
package/src/pattern/edit.js
CHANGED
|
@@ -9,6 +9,11 @@ import {
|
|
|
9
9
|
useBlockProps,
|
|
10
10
|
} from '@wordpress/block-editor';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { unlock } from '../lock-unlock';
|
|
16
|
+
|
|
12
17
|
const PatternEdit = ( { attributes, clientId } ) => {
|
|
13
18
|
const selectedPattern = useSelect(
|
|
14
19
|
( select ) =>
|
|
@@ -20,6 +25,10 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
20
25
|
|
|
21
26
|
const { replaceBlocks, __unstableMarkNextChangeAsNotPersistent } =
|
|
22
27
|
useDispatch( blockEditorStore );
|
|
28
|
+
const { setBlockEditingMode } = unlock( useDispatch( blockEditorStore ) );
|
|
29
|
+
const { getBlockRootClientId, getBlockEditingMode } = unlock(
|
|
30
|
+
useSelect( blockEditorStore )
|
|
31
|
+
);
|
|
23
32
|
|
|
24
33
|
// Run this effect when the component loads.
|
|
25
34
|
// This adds the Pattern's contents to the post.
|
|
@@ -33,13 +42,22 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
33
42
|
// because nested pattern blocks cannot be inserted if the parent block supports
|
|
34
43
|
// inner blocks but doesn't have blockSettings in the state.
|
|
35
44
|
window.queueMicrotask( () => {
|
|
45
|
+
const rootClientId = getBlockRootClientId( clientId );
|
|
36
46
|
// Clone blocks from the pattern before insertion to ensure they receive
|
|
37
47
|
// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.
|
|
38
48
|
const clonedBlocks = selectedPattern.blocks.map( ( block ) =>
|
|
39
49
|
cloneBlock( block )
|
|
40
50
|
);
|
|
51
|
+
const rootEditingMode = getBlockEditingMode( rootClientId );
|
|
52
|
+
// Temporarily set the root block to default mode to allow replacing the pattern.
|
|
53
|
+
// This could happen when the page is disabling edits of non-content blocks.
|
|
54
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
55
|
+
setBlockEditingMode( rootClientId, 'default' );
|
|
41
56
|
__unstableMarkNextChangeAsNotPersistent();
|
|
42
57
|
replaceBlocks( clientId, clonedBlocks );
|
|
58
|
+
// Restore the root block's original mode.
|
|
59
|
+
__unstableMarkNextChangeAsNotPersistent();
|
|
60
|
+
setBlockEditingMode( rootClientId, rootEditingMode );
|
|
43
61
|
} );
|
|
44
62
|
}
|
|
45
63
|
}, [
|
|
@@ -47,6 +65,9 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
47
65
|
selectedPattern?.blocks,
|
|
48
66
|
__unstableMarkNextChangeAsNotPersistent,
|
|
49
67
|
replaceBlocks,
|
|
68
|
+
getBlockEditingMode,
|
|
69
|
+
setBlockEditingMode,
|
|
70
|
+
getBlockRootClientId,
|
|
50
71
|
] );
|
|
51
72
|
|
|
52
73
|
const props = useBlockProps();
|
package/src/pattern/index.php
CHANGED
|
@@ -22,6 +22,8 @@ function register_block_core_pattern() {
|
|
|
22
22
|
/**
|
|
23
23
|
* Renders the `core/pattern` block on the server.
|
|
24
24
|
*
|
|
25
|
+
* @since 6.3.0 Backwards compatibility: blocks with no `syncStatus` attribute do not receive block wrapper.
|
|
26
|
+
*
|
|
25
27
|
* @param array $attributes Block attributes.
|
|
26
28
|
*
|
|
27
29
|
* @return string Returns the output of the pattern.
|
|
@@ -39,7 +41,17 @@ function render_block_core_pattern( $attributes ) {
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
$pattern = $registry->get_registered( $slug );
|
|
42
|
-
|
|
44
|
+
$content = $pattern['content'];
|
|
45
|
+
|
|
46
|
+
$gutenberg_experiments = get_option( 'gutenberg-experiments' );
|
|
47
|
+
if ( $gutenberg_experiments && ! empty( $gutenberg_experiments['gutenberg-auto-inserting-blocks'] ) ) {
|
|
48
|
+
// TODO: In the long run, we'd likely want to have a filter in the `WP_Block_Patterns_Registry` class
|
|
49
|
+
// instead to allow us plugging in code like this.
|
|
50
|
+
$blocks = parse_blocks( $content );
|
|
51
|
+
$content = gutenberg_serialize_blocks( $blocks );
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return do_blocks( $content );
|
|
43
55
|
}
|
|
44
56
|
|
|
45
57
|
add_action( 'init', 'register_block_core_pattern' );
|
|
@@ -34,6 +34,8 @@ function block_core_post_template_uses_featured_image( $inner_blocks ) {
|
|
|
34
34
|
/**
|
|
35
35
|
* Renders the `core/post-template` block on the server.
|
|
36
36
|
*
|
|
37
|
+
* @since 6.3.0 Changed render_block_context priority to `1`.
|
|
38
|
+
*
|
|
37
39
|
* @param array $attributes Block attributes.
|
|
38
40
|
* @param string $content Block default content.
|
|
39
41
|
* @param WP_Block $block Block instance.
|
|
@@ -97,11 +99,13 @@ function render_block_core_post_template( $attributes, $content, $block ) {
|
|
|
97
99
|
$context['postId'] = $post_id;
|
|
98
100
|
return $context;
|
|
99
101
|
};
|
|
100
|
-
|
|
102
|
+
|
|
103
|
+
// Use an early priority to so that other 'render_block_context' filters have access to the values.
|
|
104
|
+
add_filter( 'render_block_context', $filter_block_context, 1 );
|
|
101
105
|
// Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling
|
|
102
106
|
// `render_callback` and ensure that no wrapper markup is included.
|
|
103
107
|
$block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) );
|
|
104
|
-
remove_filter( 'render_block_context', $filter_block_context );
|
|
108
|
+
remove_filter( 'render_block_context', $filter_block_context, 1 );
|
|
105
109
|
|
|
106
110
|
// Wrap the render inner blocks in a `li` element with the appropriate post classes.
|
|
107
111
|
$post_classes = implode( ' ', get_post_class( 'wp-block-post' ) );
|
package/src/post-title/index.php
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Renders the `core/post-title` block on the server.
|
|
10
10
|
*
|
|
11
|
+
* @since 6.3.0 Omitting the $post argument from the `get_the_title`.
|
|
12
|
+
*
|
|
11
13
|
* @param array $attributes Block attributes.
|
|
12
14
|
* @param string $content Block default content.
|
|
13
15
|
* @param WP_Block $block Block instance.
|
|
@@ -19,8 +21,11 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
|
|
19
21
|
return '';
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The `$post` argument is intentionally omitted so that changes are reflected when previewing a post.
|
|
26
|
+
* See: https://github.com/WordPress/gutenberg/pull/37622#issuecomment-1000932816.
|
|
27
|
+
*/
|
|
28
|
+
$title = get_the_title();
|
|
24
29
|
|
|
25
30
|
if ( ! $title ) {
|
|
26
31
|
return '';
|
|
@@ -33,7 +38,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
|
|
|
33
38
|
|
|
34
39
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
|
35
40
|
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
|
|
36
|
-
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $
|
|
41
|
+
$title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $block->context['postId'] ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
$classes = array();
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
.wp-block-preformatted {
|
|
2
|
+
// This block has customizable padding, border-box makes that more predictable.
|
|
3
|
+
box-sizing: border-box;
|
|
2
4
|
white-space: pre-wrap;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
// Add low specificity default padding when a background is used.
|
|
8
|
+
:where(.wp-block-preformatted.has-background) {
|
|
6
9
|
padding: $block-bg-padding--v $block-bg-padding--h;
|
|
7
10
|
}
|
|
@@ -39,6 +39,7 @@ exports[`Preformatted should match snapshot when content is empty 1`] = `
|
|
|
39
39
|
onSelectionChange={[Function]}
|
|
40
40
|
placeholder="Write preformatted text…"
|
|
41
41
|
placeholderTextColor="gray"
|
|
42
|
+
selectionColor="black"
|
|
42
43
|
triggerKeyCodes={[]}
|
|
43
44
|
value=""
|
|
44
45
|
/>
|
|
@@ -85,6 +86,7 @@ exports[`Preformatted should match snapshot when content is not empty 1`] = `
|
|
|
85
86
|
onSelectionChange={[Function]}
|
|
86
87
|
placeholder="Write preformatted text…"
|
|
87
88
|
placeholderTextColor="gray"
|
|
89
|
+
selectionColor="black"
|
|
88
90
|
triggerKeyCodes={[]}
|
|
89
91
|
value="<pre>Hello World!</pre>"
|
|
90
92
|
/>
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
addBlock,
|
|
6
6
|
getBlock,
|
|
7
7
|
initializeEditor,
|
|
8
|
+
selectRangeInRichText,
|
|
8
9
|
setupCoreBlocks,
|
|
9
10
|
getEditorHtml,
|
|
10
11
|
fireEvent,
|
|
@@ -45,10 +46,13 @@ describe( 'Pullquote', () => {
|
|
|
45
46
|
|
|
46
47
|
const citationTextInput =
|
|
47
48
|
within( citationBlock ).getByPlaceholderText( 'Add citation' );
|
|
48
|
-
typeInRichText( citationTextInput, 'A person'
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
typeInRichText( citationTextInput, 'A person' );
|
|
50
|
+
fireEvent( citationTextInput, 'onKeyDown', {
|
|
51
|
+
nativeEvent: {},
|
|
52
|
+
preventDefault() {},
|
|
53
|
+
keyCode: ENTER,
|
|
51
54
|
} );
|
|
55
|
+
selectRangeInRichText( citationTextInput, 2 );
|
|
52
56
|
fireEvent( citationTextInput, 'onKeyDown', {
|
|
53
57
|
nativeEvent: {},
|
|
54
58
|
preventDefault() {},
|
|
@@ -59,7 +63,11 @@ describe( 'Pullquote', () => {
|
|
|
59
63
|
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
60
64
|
"<!-- wp:pullquote -->
|
|
61
65
|
<figure class="wp-block-pullquote"><blockquote><p>A great statement.<br>Again</p><cite>A <br>person</cite></blockquote></figure>
|
|
62
|
-
<!-- /wp:pullquote -->
|
|
66
|
+
<!-- /wp:pullquote -->
|
|
67
|
+
|
|
68
|
+
<!-- wp:paragraph -->
|
|
69
|
+
<p></p>
|
|
70
|
+
<!-- /wp:paragraph -->"
|
|
63
71
|
` );
|
|
64
72
|
} );
|
|
65
73
|
} );
|
|
@@ -34,20 +34,23 @@ export default function QueryPaginationEdit( {
|
|
|
34
34
|
setAttributes,
|
|
35
35
|
clientId,
|
|
36
36
|
} ) {
|
|
37
|
-
const hasNextPreviousBlocks = useSelect(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
const hasNextPreviousBlocks = useSelect(
|
|
38
|
+
( select ) => {
|
|
39
|
+
const { getBlocks } = select( blockEditorStore );
|
|
40
|
+
const innerBlocks = getBlocks( clientId );
|
|
41
|
+
/**
|
|
42
|
+
* Show the `paginationArrow` and `showLabel` controls only if a
|
|
43
|
+
* `QueryPaginationNext/Previous` block exists.
|
|
44
|
+
*/
|
|
45
|
+
return innerBlocks?.find( ( innerBlock ) => {
|
|
46
|
+
return [
|
|
47
|
+
'core/query-pagination-next',
|
|
48
|
+
'core/query-pagination-previous',
|
|
49
|
+
].includes( innerBlock.name );
|
|
50
|
+
} );
|
|
51
|
+
},
|
|
52
|
+
[ clientId ]
|
|
53
|
+
);
|
|
51
54
|
const blockProps = useBlockProps();
|
|
52
55
|
const innerBlocksProps = useInnerBlocksProps( blockProps, {
|
|
53
56
|
template: TEMPLATE,
|
package/src/query-title/edit.js
CHANGED
|
@@ -13,9 +13,11 @@ import {
|
|
|
13
13
|
useBlockProps,
|
|
14
14
|
Warning,
|
|
15
15
|
HeadingLevelDropdown,
|
|
16
|
+
store as blockEditorStore,
|
|
16
17
|
} from '@wordpress/block-editor';
|
|
17
18
|
import { ToggleControl, PanelBody } from '@wordpress/components';
|
|
18
|
-
import { __ } from '@wordpress/i18n';
|
|
19
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
20
|
+
import { useSelect } from '@wordpress/data';
|
|
19
21
|
|
|
20
22
|
const SUPPORTED_TYPES = [ 'archive', 'search' ];
|
|
21
23
|
|
|
@@ -23,6 +25,18 @@ export default function QueryTitleEdit( {
|
|
|
23
25
|
attributes: { type, level, textAlign, showPrefix, showSearchTerm },
|
|
24
26
|
setAttributes,
|
|
25
27
|
} ) {
|
|
28
|
+
const { archiveTypeTitle, archiveNameLabel } = useSelect( ( select ) => {
|
|
29
|
+
const { getSettings } = select( blockEditorStore );
|
|
30
|
+
const {
|
|
31
|
+
__experimentalArchiveTitleNameLabel,
|
|
32
|
+
__experimentalArchiveTitleTypeLabel,
|
|
33
|
+
} = getSettings();
|
|
34
|
+
return {
|
|
35
|
+
archiveTypeTitle: __experimentalArchiveTitleTypeLabel,
|
|
36
|
+
archiveNameLabel: __experimentalArchiveTitleNameLabel,
|
|
37
|
+
};
|
|
38
|
+
} );
|
|
39
|
+
|
|
26
40
|
const TagName = `h${ level }`;
|
|
27
41
|
const blockProps = useBlockProps( {
|
|
28
42
|
className: classnames( 'wp-block-query-title__placeholder', {
|
|
@@ -40,6 +54,38 @@ export default function QueryTitleEdit( {
|
|
|
40
54
|
|
|
41
55
|
let titleElement;
|
|
42
56
|
if ( type === 'archive' ) {
|
|
57
|
+
let title;
|
|
58
|
+
if ( archiveTypeTitle ) {
|
|
59
|
+
if ( showPrefix ) {
|
|
60
|
+
if ( archiveNameLabel ) {
|
|
61
|
+
title = sprintf(
|
|
62
|
+
/* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */
|
|
63
|
+
__( '%1$s: %2$s' ),
|
|
64
|
+
archiveTypeTitle,
|
|
65
|
+
archiveNameLabel
|
|
66
|
+
);
|
|
67
|
+
} else {
|
|
68
|
+
title = sprintf(
|
|
69
|
+
/* translators: %s: Archive type title e.g: "Category", "Tag"... */
|
|
70
|
+
__( '%s: Name' ),
|
|
71
|
+
archiveTypeTitle
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
} else if ( archiveNameLabel ) {
|
|
75
|
+
title = archiveNameLabel;
|
|
76
|
+
} else {
|
|
77
|
+
title = sprintf(
|
|
78
|
+
/* translators: %s: Archive type title e.g: "Category", "Tag"... */
|
|
79
|
+
__( '%s name' ),
|
|
80
|
+
archiveTypeTitle
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
title = showPrefix
|
|
85
|
+
? __( 'Archive type: Name' )
|
|
86
|
+
: __( 'Archive title' );
|
|
87
|
+
}
|
|
88
|
+
|
|
43
89
|
titleElement = (
|
|
44
90
|
<>
|
|
45
91
|
<InspectorControls>
|
|
@@ -54,11 +100,7 @@ export default function QueryTitleEdit( {
|
|
|
54
100
|
/>
|
|
55
101
|
</PanelBody>
|
|
56
102
|
</InspectorControls>
|
|
57
|
-
<TagName { ...blockProps }>
|
|
58
|
-
{ showPrefix
|
|
59
|
-
? __( 'Archive type: Name' )
|
|
60
|
-
: __( 'Archive title' ) }
|
|
61
|
-
</TagName>
|
|
103
|
+
<TagName { ...blockProps }>{ title }</TagName>
|
|
62
104
|
</>
|
|
63
105
|
);
|
|
64
106
|
}
|
|
@@ -22,6 +22,16 @@ exports[`Quote block transforms to Group block 1`] = `
|
|
|
22
22
|
<!-- /wp:group -->"
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
+
exports[`Quote block transforms to Paragraph block 1`] = `
|
|
26
|
+
"<!-- wp:paragraph -->
|
|
27
|
+
<p>"This will make running your own blog a viable alternative again."</p>
|
|
28
|
+
<!-- /wp:paragraph -->
|
|
29
|
+
|
|
30
|
+
<!-- wp:paragraph -->
|
|
31
|
+
<p>— <a href="https://twitter.com/azumbrunnen_/status/1019347243084800005">Adrian Zumbrunnen</a></p>
|
|
32
|
+
<!-- /wp:paragraph -->"
|
|
33
|
+
`;
|
|
34
|
+
|
|
25
35
|
exports[`Quote block transforms to Pullquote block 1`] = `
|
|
26
36
|
"<!-- wp:pullquote -->
|
|
27
37
|
<figure class="wp-block-pullquote"><blockquote><p>"This will make running your own blog a viable alternative again."</p><cite>— <a href="https://twitter.com/azumbrunnen_/status/1019347243084800005">Adrian Zumbrunnen</a></cite></blockquote></figure>
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
addBlock,
|
|
6
6
|
getBlock,
|
|
7
7
|
initializeEditor,
|
|
8
|
+
selectRangeInRichText,
|
|
8
9
|
setupCoreBlocks,
|
|
9
10
|
getEditorHtml,
|
|
10
11
|
fireEvent,
|
|
@@ -62,10 +63,13 @@ describe( 'Quote', () => {
|
|
|
62
63
|
typeInRichText( quoteTextInput, 'Again.' );
|
|
63
64
|
const citationTextInput =
|
|
64
65
|
within( citationBlock ).getByPlaceholderText( 'Add citation' );
|
|
65
|
-
typeInRichText( citationTextInput, 'A person'
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
typeInRichText( citationTextInput, 'A person' );
|
|
67
|
+
fireEvent( citationTextInput, 'onKeyDown', {
|
|
68
|
+
nativeEvent: {},
|
|
69
|
+
preventDefault() {},
|
|
70
|
+
keyCode: ENTER,
|
|
68
71
|
} );
|
|
72
|
+
selectRangeInRichText( citationTextInput, 2 );
|
|
69
73
|
fireEvent( citationTextInput, 'onKeyDown', {
|
|
70
74
|
nativeEvent: {},
|
|
71
75
|
preventDefault() {},
|
|
@@ -82,7 +86,11 @@ describe( 'Quote', () => {
|
|
|
82
86
|
<!-- wp:paragraph -->
|
|
83
87
|
<p>Again.</p>
|
|
84
88
|
<!-- /wp:paragraph --><cite>A <br>person</cite></blockquote>
|
|
85
|
-
<!-- /wp:quote -->
|
|
89
|
+
<!-- /wp:quote -->
|
|
90
|
+
|
|
91
|
+
<!-- wp:paragraph -->
|
|
92
|
+
<p></p>
|
|
93
|
+
<!-- /wp:paragraph -->"
|
|
86
94
|
` );
|
|
87
95
|
} );
|
|
88
96
|
} );
|
|
@@ -21,7 +21,11 @@ const initialHtml = `
|
|
|
21
21
|
<!-- /wp:quote -->`;
|
|
22
22
|
|
|
23
23
|
const transformsWithInnerBlocks = [ 'Columns', 'Group' ];
|
|
24
|
-
const blockTransforms = [
|
|
24
|
+
const blockTransforms = [
|
|
25
|
+
'Pullquote',
|
|
26
|
+
'Paragraph',
|
|
27
|
+
...transformsWithInnerBlocks,
|
|
28
|
+
];
|
|
25
29
|
|
|
26
30
|
setupCoreBlocks();
|
|
27
31
|
|
package/src/quote/transforms.js
CHANGED
|
@@ -109,6 +109,19 @@ const transforms = {
|
|
|
109
109
|
} );
|
|
110
110
|
},
|
|
111
111
|
},
|
|
112
|
+
{
|
|
113
|
+
type: 'block',
|
|
114
|
+
blocks: [ 'core/paragraph' ],
|
|
115
|
+
transform: ( { citation }, innerBlocks ) =>
|
|
116
|
+
citation
|
|
117
|
+
? [
|
|
118
|
+
...innerBlocks,
|
|
119
|
+
createBlock( 'core/paragraph', {
|
|
120
|
+
content: citation,
|
|
121
|
+
} ),
|
|
122
|
+
]
|
|
123
|
+
: innerBlocks,
|
|
124
|
+
},
|
|
112
125
|
{
|
|
113
126
|
type: 'block',
|
|
114
127
|
blocks: [ 'core/group' ],
|
package/src/rss/edit.js
CHANGED
|
@@ -116,6 +116,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
116
116
|
<PanelBody title={ __( 'Settings' ) }>
|
|
117
117
|
<RangeControl
|
|
118
118
|
__nextHasNoMarginBottom
|
|
119
|
+
__next40pxDefaultSize
|
|
119
120
|
label={ __( 'Number of items' ) }
|
|
120
121
|
value={ itemsToShow }
|
|
121
122
|
onChange={ ( value ) =>
|
|
@@ -146,6 +147,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
146
147
|
{ displayExcerpt && (
|
|
147
148
|
<RangeControl
|
|
148
149
|
__nextHasNoMarginBottom
|
|
150
|
+
__next40pxDefaultSize
|
|
149
151
|
label={ __( 'Max number of words in excerpt' ) }
|
|
150
152
|
value={ excerptLength }
|
|
151
153
|
onChange={ ( value ) =>
|
|
@@ -159,6 +161,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
|
|
|
159
161
|
{ blockLayout === 'grid' && (
|
|
160
162
|
<RangeControl
|
|
161
163
|
__nextHasNoMarginBottom
|
|
164
|
+
__next40pxDefaultSize
|
|
162
165
|
label={ __( 'Columns' ) }
|
|
163
166
|
value={ columns }
|
|
164
167
|
onChange={ ( value ) =>
|
package/src/search/block.json
CHANGED
package/src/search/edit.js
CHANGED
|
@@ -97,8 +97,8 @@ export default function SearchEdit( {
|
|
|
97
97
|
);
|
|
98
98
|
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
99
99
|
useDispatch( blockEditorStore );
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
|
|
101
|
+
if ( insertedInNavigationBlock ) {
|
|
102
102
|
// This side-effect should not create an undo level.
|
|
103
103
|
__unstableMarkNextChangeAsNotPersistent();
|
|
104
104
|
setAttributes( {
|
|
@@ -106,7 +106,8 @@ export default function SearchEdit( {
|
|
|
106
106
|
buttonUseIcon: true,
|
|
107
107
|
buttonPosition: 'button-inside',
|
|
108
108
|
} );
|
|
109
|
-
}
|
|
109
|
+
}
|
|
110
|
+
|
|
110
111
|
const borderRadius = style?.border?.radius;
|
|
111
112
|
const borderProps = useBorderProps( attributes );
|
|
112
113
|
|
package/src/search/index.php
CHANGED
|
@@ -8,11 +8,15 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Dynamically renders the `core/search` block.
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
11
|
+
* @since 6.3.0 Using block.json `viewScript` to register script, and update `view_script_handles()` only when needed.
|
|
12
|
+
*
|
|
13
|
+
* @param array $attributes The block attributes.
|
|
14
|
+
* @param string $content The saved content.
|
|
15
|
+
* @param WP_Block $block The parsed block.
|
|
12
16
|
*
|
|
13
17
|
* @return string The search block markup.
|
|
14
18
|
*/
|
|
15
|
-
function render_block_core_search( $attributes ) {
|
|
19
|
+
function render_block_core_search( $attributes, $content, $block ) {
|
|
16
20
|
// Older versions of the Search block defaulted the label and buttonText
|
|
17
21
|
// attributes to `__( 'Search' )` meaning that many posts contain `<!--
|
|
18
22
|
// wp:search /-->`. Support these by defaulting an undefined label and
|
|
@@ -70,10 +74,26 @@ function render_block_core_search( $attributes ) {
|
|
|
70
74
|
$input->set_attribute( 'id', $input_id );
|
|
71
75
|
$input->set_attribute( 'value', get_search_query() );
|
|
72
76
|
$input->set_attribute( 'placeholder', $attributes['placeholder'] );
|
|
73
|
-
|
|
77
|
+
|
|
78
|
+
$is_expandable_searchfield = 'button-only' === $button_position && 'expand-searchfield' === $button_behavior;
|
|
79
|
+
if ( $is_expandable_searchfield ) {
|
|
74
80
|
$input->set_attribute( 'aria-hidden', 'true' );
|
|
75
81
|
$input->set_attribute( 'tabindex', '-1' );
|
|
76
|
-
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// If the script already exists, there is no point in removing it from viewScript.
|
|
85
|
+
$view_js_file = 'wp-block-search-view';
|
|
86
|
+
if ( ! wp_script_is( $view_js_file ) ) {
|
|
87
|
+
$script_handles = $block->block_type->view_script_handles;
|
|
88
|
+
|
|
89
|
+
// If the script is not needed, and it is still in the `view_script_handles`, remove it.
|
|
90
|
+
if ( ! $is_expandable_searchfield && in_array( $view_js_file, $script_handles, true ) ) {
|
|
91
|
+
$block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
|
|
92
|
+
}
|
|
93
|
+
// If the script is needed, but it was previously removed, add it again.
|
|
94
|
+
if ( $is_expandable_searchfield && ! in_array( $view_js_file, $script_handles, true ) ) {
|
|
95
|
+
$block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
|
|
96
|
+
}
|
|
77
97
|
}
|
|
78
98
|
}
|
|
79
99
|
|
|
@@ -120,8 +140,10 @@ function render_block_core_search( $attributes ) {
|
|
|
120
140
|
$button->add_class( implode( ' ', $button_classes ) );
|
|
121
141
|
if ( 'expand-searchfield' === $attributes['buttonBehavior'] && 'button-only' === $attributes['buttonPosition'] ) {
|
|
122
142
|
$button->set_attribute( 'aria-label', __( 'Expand search field' ) );
|
|
143
|
+
$button->set_attribute( 'data-toggled-aria-label', __( 'Submit Search' ) );
|
|
123
144
|
$button->set_attribute( 'aria-controls', 'wp-block-search__input-' . $input_id );
|
|
124
145
|
$button->set_attribute( 'aria-expanded', 'false' );
|
|
146
|
+
$button->set_attribute( 'type', 'button' ); // Will be set to submit after clicking.
|
|
125
147
|
} else {
|
|
126
148
|
$button->set_attribute( 'aria-label', wp_strip_all_tags( $attributes['buttonText'] ) );
|
|
127
149
|
}
|