@wordpress/block-library 6.0.17 → 6.0.23
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/build/columns/index.js +1 -2
- package/build/columns/index.js.map +1 -1
- package/build/gallery/deprecated.js +1 -5
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit.js +0 -7
- package/build/gallery/edit.js.map +1 -1
- package/build/navigation/index.js +1 -6
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view.js +1 -1
- package/build/navigation/view.js.map +1 -1
- package/build/post-author/edit.js +1 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-content/edit.js +1 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -1
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-title/edit.js +1 -1
- package/build/post-title/edit.js.map +1 -1
- package/build/site-logo/edit.js +110 -12
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +5 -1
- package/build/site-logo/index.js.map +1 -1
- package/build/template-part/index.js +25 -9
- package/build/template-part/index.js.map +1 -1
- package/build-module/columns/index.js +1 -2
- package/build-module/columns/index.js.map +1 -1
- package/build-module/gallery/deprecated.js +2 -6
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit.js +0 -6
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/navigation/index.js +1 -6
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view.js +1 -1
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/post-author/edit.js +1 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-content/edit.js +1 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -1
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-title/edit.js +1 -1
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +111 -13
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +5 -1
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/template-part/index.js +25 -9
- package/build-module/template-part/index.js.map +1 -1
- package/build-style/common-rtl.css +2 -2
- package/build-style/common.css +2 -2
- package/build-style/editor-rtl.css +20 -10
- package/build-style/editor.css +20 -10
- package/build-style/navigation/editor-rtl.css +13 -6
- package/build-style/navigation/editor.css +13 -6
- package/build-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/page-list/style-rtl.css +4 -4
- package/build-style/page-list/style.css +4 -4
- package/build-style/post-template/style-rtl.css +2 -29
- package/build-style/post-template/style.css +2 -29
- package/build-style/style-rtl.css +9 -35
- package/build-style/style.css +9 -35
- package/package.json +8 -9
- package/src/columns/block.json +1 -2
- package/src/common.scss +2 -2
- package/src/editor.scss +7 -4
- package/src/gallery/deprecated.js +2 -5
- package/src/gallery/edit.js +0 -7
- package/src/navigation/block.json +1 -12
- package/src/navigation/editor.scss +18 -8
- package/src/navigation/style.scss +1 -0
- package/src/navigation/view.js +1 -1
- package/src/navigation-submenu/index.php +2 -2
- package/src/page-list/index.php +1 -1
- package/src/page-list/style.scss +4 -4
- package/src/post-author/edit.js +1 -1
- package/src/post-content/edit.js +1 -1
- package/src/post-content/index.php +11 -1
- package/src/post-date/edit.js +1 -1
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-excerpt/index.php +1 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-template/style.scss +2 -13
- package/src/post-title/edit.js +1 -1
- package/src/post-title/index.php +1 -1
- package/src/query-pagination-next/index.php +3 -2
- package/src/search/index.php +9 -9
- package/src/site-logo/block.json +5 -1
- package/src/site-logo/edit.js +127 -9
- package/src/site-logo/index.php +17 -0
- package/src/template-part/block.json +0 -8
- package/src/template-part/index.js +28 -0
- package/build/gallery/use-mobile-warning.js +0 -43
- package/build/gallery/use-mobile-warning.js.map +0 -1
- package/build-module/gallery/use-mobile-warning.js +0 -32
- package/build-module/gallery/use-mobile-warning.js.map +0 -1
- package/src/gallery/use-mobile-warning.js +0 -28
package/src/editor.scss
CHANGED
|
@@ -48,8 +48,11 @@
|
|
|
48
48
|
@include background-colors-deprecated();
|
|
49
49
|
@include foreground-colors-deprecated();
|
|
50
50
|
@include gradient-colors-deprecated();
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// This CSS Custom Properties aren't used anymore as defaults,
|
|
54
|
+
// but we still need to keep them for backward compatibility.
|
|
55
|
+
.editor-styles-wrapper {
|
|
53
56
|
--wp--preset--font-size--normal: 16px;
|
|
54
57
|
--wp--preset--font-size--huge: 42px;
|
|
55
58
|
}
|
|
@@ -67,11 +70,11 @@
|
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
.editor-styles-wrapper .has-normal-font-size {
|
|
70
|
-
font-size: var(--wp--preset--font-size--normal)
|
|
73
|
+
font-size: var(--wp--preset--font-size--normal);
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
.editor-styles-wrapper .has-huge-font-size {
|
|
74
|
-
font-size: var(--wp--preset--font-size--huge)
|
|
77
|
+
font-size: var(--wp--preset--font-size--huge);
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
/**
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import { map, some } from 'lodash';
|
|
5
|
+
import { map, some, omit } from 'lodash';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
@@ -97,11 +97,8 @@ function runV2Migration( attributes ) {
|
|
|
97
97
|
|
|
98
98
|
return [
|
|
99
99
|
{
|
|
100
|
-
|
|
101
|
-
columns: attributes.columns,
|
|
102
|
-
imageCrop: attributes.imageCrop,
|
|
100
|
+
...omit( attributes, [ 'images', 'ids' ] ),
|
|
103
101
|
linkTo,
|
|
104
|
-
sizeSlug: attributes.sizeSlug,
|
|
105
102
|
allowResize: false,
|
|
106
103
|
},
|
|
107
104
|
imageBlocks,
|
package/src/gallery/edit.js
CHANGED
|
@@ -53,11 +53,6 @@ import useShortCodeTransform from './use-short-code-transform';
|
|
|
53
53
|
import useGetNewImages from './use-get-new-images';
|
|
54
54
|
import useGetMedia from './use-get-media';
|
|
55
55
|
|
|
56
|
-
/**
|
|
57
|
-
* Internal dependencies
|
|
58
|
-
*/
|
|
59
|
-
import useMobileWarning from './use-mobile-warning';
|
|
60
|
-
|
|
61
56
|
const MAX_COLUMNS = 8;
|
|
62
57
|
const linkOptions = [
|
|
63
58
|
{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },
|
|
@@ -139,8 +134,6 @@ function GalleryEdit( props ) {
|
|
|
139
134
|
|
|
140
135
|
const newImages = useGetNewImages( images, imageData );
|
|
141
136
|
|
|
142
|
-
useMobileWarning( newImages );
|
|
143
|
-
|
|
144
137
|
useEffect( () => {
|
|
145
138
|
newImages?.forEach( ( newImage ) => {
|
|
146
139
|
updateBlockAttributes( newImage.clientId, {
|
|
@@ -92,23 +92,12 @@
|
|
|
92
92
|
"__experimentalFontWeight": true,
|
|
93
93
|
"__experimentalTextTransform": true,
|
|
94
94
|
"__experimentalFontFamily": true,
|
|
95
|
-
"__experimentalTextDecoration": true,
|
|
96
95
|
"__experimentalDefaultControls": {
|
|
97
96
|
"fontSize": true
|
|
98
97
|
}
|
|
99
98
|
},
|
|
100
99
|
"spacing": {
|
|
101
|
-
"
|
|
102
|
-
"units": [
|
|
103
|
-
"px",
|
|
104
|
-
"em",
|
|
105
|
-
"rem",
|
|
106
|
-
"vh",
|
|
107
|
-
"vw"
|
|
108
|
-
],
|
|
109
|
-
"__experimentalDefaultControls": {
|
|
110
|
-
"blockGap": true
|
|
111
|
-
}
|
|
100
|
+
"units": [ "px", "em", "rem", "vh", "vw" ]
|
|
112
101
|
},
|
|
113
102
|
"__experimentalLayout": {
|
|
114
103
|
"allowSwitching": false,
|
|
@@ -305,7 +305,6 @@ $color-control-label-height: 20px;
|
|
|
305
305
|
|
|
306
306
|
// Selected state.
|
|
307
307
|
.wp-block-navigation-placeholder__controls {
|
|
308
|
-
padding: $grid-unit-10;
|
|
309
308
|
border-radius: $radius-block-ui;
|
|
310
309
|
background-color: $white;
|
|
311
310
|
box-shadow: inset 0 0 0 $border-width $gray-900;
|
|
@@ -314,11 +313,7 @@ $color-control-label-height: 20px;
|
|
|
314
313
|
display: none;
|
|
315
314
|
position: relative;
|
|
316
315
|
z-index: 1;
|
|
317
|
-
|
|
318
|
-
// Adjust padding for when shown horizontally.
|
|
319
|
-
.is-large & {
|
|
320
|
-
padding: $grid-unit-05 $grid-unit-10;
|
|
321
|
-
}
|
|
316
|
+
padding: $grid-unit-05 $grid-unit-10;
|
|
322
317
|
|
|
323
318
|
// If an ancestor has a text-decoration property applied, it is inherited regardless of
|
|
324
319
|
// the specificity of a child element. Only pulling the child out of the flow fixes it.
|
|
@@ -331,9 +326,19 @@ $color-control-label-height: 20px;
|
|
|
331
326
|
display: flex;
|
|
332
327
|
}
|
|
333
328
|
|
|
334
|
-
//
|
|
335
|
-
.
|
|
329
|
+
// Hide a few elements in medium size placeholders.
|
|
330
|
+
// @todo: part of the code here will be irrelevant if https://github.com/WordPress/gutenberg/pull/36775 lands.
|
|
336
331
|
.is-medium & {
|
|
332
|
+
.wp-block-navigation-placeholder__actions__indicator,
|
|
333
|
+
.wp-block-navigation-placeholder__actions__indicator + hr,
|
|
334
|
+
.wp-block-navigation-placeholder__actions > :nth-last-child(3), // Add all pages.
|
|
335
|
+
.wp-block-navigation-placeholder__actions > :nth-last-child(2) { // hr separator after it.
|
|
336
|
+
display: none;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// Show stacked for the vertical navigation, or small placeholders.
|
|
341
|
+
.is-small & {
|
|
337
342
|
.wp-block-navigation-placeholder__actions {
|
|
338
343
|
flex-direction: column;
|
|
339
344
|
}
|
|
@@ -367,6 +372,11 @@ $color-control-label-height: 20px;
|
|
|
367
372
|
}
|
|
368
373
|
}
|
|
369
374
|
|
|
375
|
+
// Keep as row for medium.
|
|
376
|
+
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset {
|
|
377
|
+
flex-direction: row !important;
|
|
378
|
+
}
|
|
379
|
+
|
|
370
380
|
.wp-block-navigation-placeholder__actions {
|
|
371
381
|
display: flex;
|
|
372
382
|
font-size: $default-font-size;
|
package/src/navigation/view.js
CHANGED
|
@@ -5,7 +5,7 @@ import MicroModal from 'micromodal';
|
|
|
5
5
|
|
|
6
6
|
// Responsive navigation toggle.
|
|
7
7
|
function navigationToggleModal( modal ) {
|
|
8
|
-
const dialogContainer =
|
|
8
|
+
const dialogContainer = modal.querySelector(
|
|
9
9
|
`.wp-block-navigation__responsive-dialog`
|
|
10
10
|
);
|
|
11
11
|
|
|
@@ -191,7 +191,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
191
191
|
$aria_label = sprintf(
|
|
192
192
|
/* translators: Accessibility text. %s: Parent page title. */
|
|
193
193
|
__( '%s submenu' ),
|
|
194
|
-
$label
|
|
194
|
+
wp_strip_all_tags( $label )
|
|
195
195
|
);
|
|
196
196
|
|
|
197
197
|
$html = '<li ' . $wrapper_attributes . '>';
|
|
@@ -231,7 +231,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
231
231
|
|
|
232
232
|
if ( $show_submenu_indicators ) {
|
|
233
233
|
// The submenu icon is rendered in a button here
|
|
234
|
-
// so that there's a clickable
|
|
234
|
+
// so that there's a clickable element to open the submenu.
|
|
235
235
|
$html .= '<button aria-label="' . $aria_label . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
|
|
236
236
|
}
|
|
237
237
|
} else {
|
package/src/page-list/index.php
CHANGED
|
@@ -177,7 +177,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
|
|
|
177
177
|
$aria_label = sprintf(
|
|
178
178
|
/* translators: Accessibility text. %s: Parent page title. */
|
|
179
179
|
__( '%s submenu' ),
|
|
180
|
-
$title
|
|
180
|
+
wp_strip_all_tags( $title )
|
|
181
181
|
);
|
|
182
182
|
|
|
183
183
|
$markup .= '<li class="wp-block-pages-list__item' . $css_class . '"' . $style_attribute . '>';
|
package/src/page-list/style.scss
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
.wp-block-navigation {
|
|
3
3
|
.wp-block-page-list {
|
|
4
4
|
display: flex;
|
|
5
|
-
flex-direction: var(--layout-direction, initial);
|
|
6
|
-
justify-content: var(--layout-justify, initial);
|
|
7
|
-
align-items: var(--layout-align, initial);
|
|
8
|
-
flex-wrap: var(--layout-wrap, wrap);
|
|
5
|
+
flex-direction: var(--navigation-layout-direction, initial);
|
|
6
|
+
justify-content: var(--navigation-layout-justify, initial);
|
|
7
|
+
align-items: var(--navigation-layout-align, initial);
|
|
8
|
+
flex-wrap: var(--navigation-layout-wrap, wrap);
|
|
9
9
|
background-color: inherit;
|
|
10
10
|
}
|
|
11
11
|
|
package/src/post-author/edit.js
CHANGED
|
@@ -25,7 +25,7 @@ function PostAuthorEdit( {
|
|
|
25
25
|
attributes,
|
|
26
26
|
setAttributes,
|
|
27
27
|
} ) {
|
|
28
|
-
const isDescendentOfQueryLoop =
|
|
28
|
+
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
29
29
|
const { authorId, authorDetails, authors } = useSelect(
|
|
30
30
|
( select ) => {
|
|
31
31
|
const { getEditedEntityRecord, getUser, getUsers } = select(
|
package/src/post-content/edit.js
CHANGED
|
@@ -66,7 +66,7 @@ function EditableContent( { layout, context = {} } ) {
|
|
|
66
66
|
|
|
67
67
|
function Content( props ) {
|
|
68
68
|
const { context: { queryId, postType, postId } = {} } = props;
|
|
69
|
-
const isDescendentOfQueryLoop =
|
|
69
|
+
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
70
70
|
const userCanEdit = useCanEditEntity( 'postType', postType, postId );
|
|
71
71
|
const isEditable = userCanEdit && ! isDescendentOfQueryLoop;
|
|
72
72
|
|
|
@@ -36,11 +36,21 @@ function render_block_core_post_content( $attributes, $content, $block ) {
|
|
|
36
36
|
|
|
37
37
|
$seen_ids[ $post_id ] = true;
|
|
38
38
|
|
|
39
|
+
// Check is needed for backward compatibility with third-party plugins
|
|
40
|
+
// that might rely on the `in_the_loop` check; calling `the_post` sets it to true.
|
|
39
41
|
if ( ! in_the_loop() && have_posts() ) {
|
|
40
42
|
the_post();
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
// When inside the main loop, we want to use queried object
|
|
46
|
+
// so that `the_preview` for the current post can apply.
|
|
47
|
+
// We force this behavior by omitting the third argument (post ID) from the `get_the_content`.
|
|
48
|
+
$content = get_the_content( null, false );
|
|
49
|
+
// Check for nextpage to display page links for paginated posts.
|
|
50
|
+
if ( has_block( 'core/nextpage' ) ) {
|
|
51
|
+
$content .= wp_link_pages( array( 'echo' => 0 ) );
|
|
52
|
+
}
|
|
53
|
+
|
|
44
54
|
/** This filter is documented in wp-includes/post-template.php */
|
|
45
55
|
$content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
|
|
46
56
|
unset( $seen_ids[ $post_id ] );
|
package/src/post-date/edit.js
CHANGED
|
@@ -33,7 +33,7 @@ export default function PostDateEdit( {
|
|
|
33
33
|
context: { postId, postType, queryId },
|
|
34
34
|
setAttributes,
|
|
35
35
|
} ) {
|
|
36
|
-
const isDescendentOfQueryLoop =
|
|
36
|
+
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
37
37
|
const [ siteFormat ] = useEntityProp( 'root', 'site', 'date_format' );
|
|
38
38
|
const [ date, setDate ] = useEntityProp(
|
|
39
39
|
'postType',
|
package/src/post-excerpt/edit.js
CHANGED
|
@@ -30,7 +30,7 @@ export default function PostExcerptEditor( {
|
|
|
30
30
|
isSelected,
|
|
31
31
|
context: { postId, postType, queryId },
|
|
32
32
|
} ) {
|
|
33
|
-
const isDescendentOfQueryLoop =
|
|
33
|
+
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
34
34
|
const userCanEdit = useCanEditEntity( 'postType', postType, postId );
|
|
35
35
|
const isEditable = userCanEdit && ! isDescendentOfQueryLoop;
|
|
36
36
|
const [
|
|
@@ -50,7 +50,7 @@ function PostFeaturedImageDisplay( {
|
|
|
50
50
|
setAttributes,
|
|
51
51
|
context: { postId, postType, queryId },
|
|
52
52
|
} ) {
|
|
53
|
-
const isDescendentOfQueryLoop =
|
|
53
|
+
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
54
54
|
const { isLink, height, width, scale } = attributes;
|
|
55
55
|
const [ featuredImage, setFeaturedImage ] = useEntityProp(
|
|
56
56
|
'postType',
|
|
@@ -11,32 +11,21 @@
|
|
|
11
11
|
list-style: none;
|
|
12
12
|
padding: 0;
|
|
13
13
|
|
|
14
|
-
li {
|
|
15
|
-
clear: both;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
14
|
&.is-flex-container {
|
|
19
15
|
flex-direction: row;
|
|
20
16
|
display: flex;
|
|
21
17
|
flex-wrap: wrap;
|
|
18
|
+
gap: 1.25em;
|
|
22
19
|
|
|
23
20
|
li {
|
|
24
|
-
margin: 0
|
|
21
|
+
margin: 0;
|
|
25
22
|
width: 100%;
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
@include break-small {
|
|
29
|
-
li {
|
|
30
|
-
margin-right: 1.25em;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
26
|
@for $i from 2 through 6 {
|
|
34
27
|
&.is-flex-container.columns-#{ $i } > li {
|
|
35
28
|
width: calc((100% / #{ $i }) - 1.25em + (1.25em / #{ $i }));
|
|
36
|
-
|
|
37
|
-
&:nth-child( #{ $i }n ) {
|
|
38
|
-
margin-right: 0;
|
|
39
|
-
}
|
|
40
29
|
}
|
|
41
30
|
}
|
|
42
31
|
}
|
package/src/post-title/edit.js
CHANGED
|
@@ -30,7 +30,7 @@ export default function PostTitleEdit( {
|
|
|
30
30
|
context: { postType, postId, queryId },
|
|
31
31
|
} ) {
|
|
32
32
|
const TagName = 0 === level ? 'p' : 'h' + level;
|
|
33
|
-
const isDescendentOfQueryLoop =
|
|
33
|
+
const isDescendentOfQueryLoop = Number.isFinite( queryId );
|
|
34
34
|
const userCanEdit = useCanEditEntity( 'postType', postType, postId );
|
|
35
35
|
const [ rawTitle = '', setTitle, fullTitle ] = useEntityProp(
|
|
36
36
|
'postType',
|
package/src/post-title/index.php
CHANGED
|
@@ -43,8 +43,9 @@ function render_block_core_query_pagination_next( $attributes, $content, $block
|
|
|
43
43
|
$content = get_next_posts_link( $label, $max_page );
|
|
44
44
|
remove_filter( 'next_posts_link_attributes', $filter_link_attributes );
|
|
45
45
|
} elseif ( ! $max_page || $max_page > $page ) {
|
|
46
|
-
$custom_query
|
|
47
|
-
|
|
46
|
+
$custom_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) );
|
|
47
|
+
$custom_query_max_pages = (int) $custom_query->max_num_pages;
|
|
48
|
+
if ( $custom_query_max_pages && $custom_query_max_pages !== $page ) {
|
|
48
49
|
$content = sprintf(
|
|
49
50
|
'<a href="%1$s" %2$s>%3$s</a>',
|
|
50
51
|
esc_url( add_query_arg( $page_key, $page + 1 ) ),
|
package/src/search/index.php
CHANGED
|
@@ -46,13 +46,13 @@ function render_block_core_search( $attributes ) {
|
|
|
46
46
|
$label_markup = sprintf(
|
|
47
47
|
'<label for="%1$s" class="wp-block-search__label screen-reader-text">%2$s</label>',
|
|
48
48
|
$input_id,
|
|
49
|
-
empty( $attributes['label'] ) ? __( 'Search' ) : $attributes['label']
|
|
49
|
+
empty( $attributes['label'] ) ? __( 'Search' ) : esc_html( $attributes['label'] )
|
|
50
50
|
);
|
|
51
51
|
if ( $show_label && ! empty( $attributes['label'] ) ) {
|
|
52
52
|
$label_markup = sprintf(
|
|
53
53
|
'<label for="%1$s" class="wp-block-search__label">%2$s</label>',
|
|
54
54
|
$input_id,
|
|
55
|
-
$attributes['label']
|
|
55
|
+
esc_html( $attributes['label'] )
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -61,7 +61,7 @@ function render_block_core_search( $attributes ) {
|
|
|
61
61
|
$input_markup = sprintf(
|
|
62
62
|
'<input type="search" id="%s" class="wp-block-search__input %s" name="s" value="%s" placeholder="%s" %s required />',
|
|
63
63
|
$input_id,
|
|
64
|
-
$input_classes,
|
|
64
|
+
esc_attr( $input_classes ),
|
|
65
65
|
esc_attr( get_search_query() ),
|
|
66
66
|
esc_attr( $attributes['placeholder'] ),
|
|
67
67
|
$inline_styles['input']
|
|
@@ -77,7 +77,7 @@ function render_block_core_search( $attributes ) {
|
|
|
77
77
|
}
|
|
78
78
|
if ( ! $use_icon_button ) {
|
|
79
79
|
if ( ! empty( $attributes['buttonText'] ) ) {
|
|
80
|
-
$button_internal_markup = $attributes['buttonText'];
|
|
80
|
+
$button_internal_markup = esc_html( $attributes['buttonText'] );
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
83
|
$button_classes .= ' has-icon';
|
|
@@ -89,7 +89,7 @@ function render_block_core_search( $attributes ) {
|
|
|
89
89
|
|
|
90
90
|
$button_markup = sprintf(
|
|
91
91
|
'<button type="submit" class="wp-block-search__button %s" %s>%s</button>',
|
|
92
|
-
$button_classes,
|
|
92
|
+
esc_attr( $button_classes ),
|
|
93
93
|
$inline_styles['button'],
|
|
94
94
|
$button_internal_markup
|
|
95
95
|
);
|
|
@@ -98,7 +98,7 @@ function render_block_core_search( $attributes ) {
|
|
|
98
98
|
$field_markup_classes = $is_button_inside ? $border_color_classes : '';
|
|
99
99
|
$field_markup = sprintf(
|
|
100
100
|
'<div class="wp-block-search__inside-wrapper %s" %s>%s</div>',
|
|
101
|
-
$field_markup_classes,
|
|
101
|
+
esc_attr( $field_markup_classes ),
|
|
102
102
|
$inline_styles['wrapper'],
|
|
103
103
|
$input_markup . $button_markup
|
|
104
104
|
);
|
|
@@ -285,9 +285,9 @@ function styles_for_block_core_search( $attributes ) {
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
return array(
|
|
288
|
-
'input' => ! empty( $input_styles ) ? sprintf( ' style="%s"', implode( ' ', $input_styles ) ) : '',
|
|
289
|
-
'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', implode( ' ', $button_styles ) ) : '',
|
|
290
|
-
'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', implode( ' ', $wrapper_styles ) ) : '',
|
|
288
|
+
'input' => ! empty( $input_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $input_styles ) ) ) : '',
|
|
289
|
+
'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $button_styles ) ) ) : '',
|
|
290
|
+
'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $wrapper_styles ) ) ) : '',
|
|
291
291
|
);
|
|
292
292
|
}
|
|
293
293
|
|
package/src/site-logo/block.json
CHANGED
|
@@ -16,12 +16,16 @@
|
|
|
16
16
|
"linkTarget": {
|
|
17
17
|
"type": "string",
|
|
18
18
|
"default": "_self"
|
|
19
|
+
},
|
|
20
|
+
"shouldSyncIcon": {
|
|
21
|
+
"type": "boolean"
|
|
19
22
|
}
|
|
20
23
|
},
|
|
21
24
|
"example": {
|
|
22
25
|
"viewportWidth": 500,
|
|
23
26
|
"attributes": {
|
|
24
|
-
"width": 350
|
|
27
|
+
"width": 350,
|
|
28
|
+
"className": "block-editor-block-types-list__site-logo-example"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
"supports": {
|