@wordpress/block-library 8.22.0 → 8.23.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 +2 -0
- package/build/block/edit.js +3 -2
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +57 -2
- package/build/button/edit.js.map +1 -1
- package/build/code/transforms.js +20 -7
- package/build/code/transforms.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -0
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +1 -0
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/edit.js +1 -2
- package/build/details/edit.js.map +1 -1
- package/build/form/index.js +1 -1
- package/build/form/index.js.map +1 -1
- package/build/form-submit-button/edit.js +2 -1
- package/build/form-submit-button/edit.js.map +1 -1
- package/build/gallery/gap-styles.js +12 -7
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/group/edit.js +1 -0
- package/build/group/edit.js.map +1 -1
- package/build/html/transforms.js +7 -2
- package/build/html/transforms.js.map +1 -1
- package/build/image/deprecated.js +8 -0
- package/build/image/deprecated.js.map +1 -1
- package/build/image/view.js +10 -7
- package/build/image/view.js.map +1 -1
- package/build/missing/index.js +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +1 -1
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +2 -1
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/pattern/edit.js +1 -1
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +0 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +21 -6
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +2 -8
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/post-terms/edit.js +0 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/preformatted/transforms.js +1 -4
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/edit/query-content.js +1 -0
- package/build/query/edit/query-content.js.map +1 -1
- package/build/quote/index.js +6 -0
- package/build/quote/index.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +1 -0
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +3 -7
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/index.js +6 -2
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +5 -1
- package/build/template-part/variations.js.map +1 -1
- package/build-module/block/edit.js +3 -2
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +61 -6
- package/build-module/button/edit.js.map +1 -1
- package/build-module/code/transforms.js +20 -7
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -0
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/edit.js +1 -2
- package/build-module/details/edit.js.map +1 -1
- package/build-module/form/index.js +1 -1
- package/build-module/form/index.js.map +1 -1
- package/build-module/form-submit-button/edit.js +2 -1
- package/build-module/form-submit-button/edit.js.map +1 -1
- package/build-module/gallery/gap-styles.js +13 -8
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/group/edit.js +1 -0
- package/build-module/group/edit.js.map +1 -1
- package/build-module/html/transforms.js +7 -2
- package/build-module/html/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +8 -0
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/view.js +10 -7
- package/build-module/image/view.js.map +1 -1
- package/build-module/missing/index.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +2 -1
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation-link/edit.js +2 -2
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/pattern/edit.js +1 -1
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +0 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +21 -6
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +2 -8
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/post-terms/edit.js +0 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/preformatted/transforms.js +1 -4
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -0
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/quote/index.js +6 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -0
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +5 -9
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/index.js +6 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +5 -1
- package/build-module/template-part/variations.js.map +1 -1
- package/build-style/editor-rtl.css +12 -0
- package/build-style/editor.css +12 -0
- package/build-style/image/editor-rtl.css +3 -0
- package/build-style/image/editor.css +3 -0
- package/build-style/image/style-rtl.css +19 -13
- package/build-style/image/style.css +19 -13
- package/build-style/post-featured-image/editor-rtl.css +9 -0
- package/build-style/post-featured-image/editor.css +9 -0
- package/build-style/quote/style-rtl.css +3 -0
- package/build-style/quote/style.css +3 -0
- package/build-style/read-more/style-rtl.css +2 -2
- package/build-style/read-more/style.css +2 -2
- package/build-style/style-rtl.css +24 -15
- package/build-style/style.css +24 -15
- package/package.json +32 -32
- package/src/block/edit.js +2 -1
- package/src/button/edit.js +70 -4
- package/src/code/transforms.js +14 -8
- package/src/comments/edit/comments-inspector-controls.js +1 -0
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/details/edit.js +0 -1
- package/src/form/index.js +1 -1
- package/src/form-submit-button/edit.js +1 -0
- package/src/gallery/gap-styles.js +10 -9
- package/src/group/edit.js +1 -0
- package/src/html/transforms.js +5 -2
- package/src/image/deprecated.js +8 -0
- package/src/image/editor.scss +7 -0
- package/src/image/index.php +3 -4
- package/src/image/style.scss +18 -13
- package/src/image/view.js +24 -11
- package/src/missing/block.json +1 -1
- package/src/navigation/edit/overlay-menu-preview.js +1 -1
- package/src/navigation/index.php +37 -402
- package/src/navigation/use-template-part-area-label.js +4 -2
- package/src/navigation-link/edit.js +2 -2
- package/src/navigation-link/index.php +57 -0
- package/src/paragraph/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/paragraph/test/transforms.native.js +1 -0
- package/src/pattern/edit.js +2 -1
- package/src/pattern/index.php +6 -1
- package/src/post-author/edit.js +0 -1
- package/src/post-featured-image/edit.js +38 -5
- package/src/post-featured-image/editor.scss +19 -0
- package/src/post-template/block.json +0 -1
- package/src/post-template/edit.js +1 -5
- package/src/post-terms/edit.js +0 -2
- package/src/preformatted/transforms.js +1 -4
- package/src/query/edit/query-content.js +1 -0
- package/src/query/index.php +6 -2
- package/src/quote/block.json +6 -0
- package/src/quote/style.scss +4 -0
- package/src/read-more/style.scss +1 -1
- package/src/template-part/edit/advanced-controls.js +1 -0
- package/src/template-part/edit/index.js +7 -14
- package/src/template-part/index.js +4 -3
- package/src/template-part/index.php +4 -4
- package/src/template-part/variations.js +4 -2
|
@@ -43,6 +43,11 @@ function getMediaSourceUrlBySizeSlug( media, slug ) {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
const disabledClickProps = {
|
|
47
|
+
onClick: ( event ) => event.preventDefault(),
|
|
48
|
+
'aria-disabled': true,
|
|
49
|
+
};
|
|
50
|
+
|
|
46
51
|
export default function PostFeaturedImageEdit( {
|
|
47
52
|
clientId,
|
|
48
53
|
attributes,
|
|
@@ -67,9 +72,10 @@ export default function PostFeaturedImageEdit( {
|
|
|
67
72
|
postId
|
|
68
73
|
);
|
|
69
74
|
|
|
70
|
-
const { media, postType } = useSelect(
|
|
75
|
+
const { media, postType, postPermalink } = useSelect(
|
|
71
76
|
( select ) => {
|
|
72
|
-
const { getMedia, getPostType } =
|
|
77
|
+
const { getMedia, getPostType, getEditedEntityRecord } =
|
|
78
|
+
select( coreStore );
|
|
73
79
|
return {
|
|
74
80
|
media:
|
|
75
81
|
featuredImage &&
|
|
@@ -77,10 +83,16 @@ export default function PostFeaturedImageEdit( {
|
|
|
77
83
|
context: 'view',
|
|
78
84
|
} ),
|
|
79
85
|
postType: postTypeSlug && getPostType( postTypeSlug ),
|
|
86
|
+
postPermalink: getEditedEntityRecord(
|
|
87
|
+
'postType',
|
|
88
|
+
postTypeSlug,
|
|
89
|
+
postId
|
|
90
|
+
)?.link,
|
|
80
91
|
};
|
|
81
92
|
},
|
|
82
|
-
[ featuredImage, postTypeSlug ]
|
|
93
|
+
[ featuredImage, postTypeSlug, postId ]
|
|
83
94
|
);
|
|
95
|
+
|
|
84
96
|
const mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );
|
|
85
97
|
|
|
86
98
|
const imageSizes = useSelect(
|
|
@@ -197,7 +209,17 @@ export default function PostFeaturedImageEdit( {
|
|
|
197
209
|
<>
|
|
198
210
|
{ controls }
|
|
199
211
|
<div { ...blockProps }>
|
|
200
|
-
{
|
|
212
|
+
{ !! isLink ? (
|
|
213
|
+
<a
|
|
214
|
+
href={ postPermalink }
|
|
215
|
+
target={ linkTarget }
|
|
216
|
+
{ ...disabledClickProps }
|
|
217
|
+
>
|
|
218
|
+
{ placeholder() }
|
|
219
|
+
</a>
|
|
220
|
+
) : (
|
|
221
|
+
placeholder()
|
|
222
|
+
) }
|
|
201
223
|
<Overlay
|
|
202
224
|
attributes={ attributes }
|
|
203
225
|
setAttributes={ setAttributes }
|
|
@@ -295,7 +317,18 @@ export default function PostFeaturedImageEdit( {
|
|
|
295
317
|
</BlockControls>
|
|
296
318
|
) }
|
|
297
319
|
<figure { ...blockProps }>
|
|
298
|
-
{ image }
|
|
320
|
+
{ /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }
|
|
321
|
+
{ !! isLink ? (
|
|
322
|
+
<a
|
|
323
|
+
href={ postPermalink }
|
|
324
|
+
target={ linkTarget }
|
|
325
|
+
{ ...disabledClickProps }
|
|
326
|
+
>
|
|
327
|
+
{ image }
|
|
328
|
+
</a>
|
|
329
|
+
) : (
|
|
330
|
+
image
|
|
331
|
+
) }
|
|
299
332
|
<Overlay
|
|
300
333
|
attributes={ attributes }
|
|
301
334
|
setAttributes={ setAttributes }
|
|
@@ -96,6 +96,25 @@
|
|
|
96
96
|
height: 100%;
|
|
97
97
|
width: 100%;
|
|
98
98
|
}
|
|
99
|
+
|
|
100
|
+
// When the Post Featured Image block is linked,
|
|
101
|
+
// it's wrapped with a disabled <a /> tag.
|
|
102
|
+
// Restore cursor style so it doesn't appear 'clickable'.
|
|
103
|
+
> a {
|
|
104
|
+
cursor: default;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// When the Post Featured Image block is linked,
|
|
108
|
+
// and wrapped with a disabled <a /> tag
|
|
109
|
+
// ensure that the placeholder items are visible when selected.
|
|
110
|
+
&.is-selected .components-placeholder.has-illustration {
|
|
111
|
+
.components-button,
|
|
112
|
+
.components-placeholder__instructions,
|
|
113
|
+
.components-placeholder__label {
|
|
114
|
+
opacity: 1;
|
|
115
|
+
pointer-events: auto;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
99
118
|
}
|
|
100
119
|
|
|
101
120
|
div[data-type="core/post-featured-image"] {
|
|
@@ -96,7 +96,6 @@ export default function PostTemplateEdit( {
|
|
|
96
96
|
// REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`.
|
|
97
97
|
...restQueryArgs
|
|
98
98
|
} = {},
|
|
99
|
-
queryContext = [ { page: 1 } ],
|
|
100
99
|
templateSlug,
|
|
101
100
|
previewPostType,
|
|
102
101
|
},
|
|
@@ -104,8 +103,6 @@ export default function PostTemplateEdit( {
|
|
|
104
103
|
__unstableLayoutClassNames,
|
|
105
104
|
} ) {
|
|
106
105
|
const { type: layoutType, columnCount = 3 } = layout || {};
|
|
107
|
-
|
|
108
|
-
const [ { page } ] = queryContext;
|
|
109
106
|
const [ activeBlockContextId, setActiveBlockContextId ] = useState();
|
|
110
107
|
const { posts, blocks } = useSelect(
|
|
111
108
|
( select ) => {
|
|
@@ -126,7 +123,7 @@ export default function PostTemplateEdit( {
|
|
|
126
123
|
slug: templateSlug.replace( 'category-', '' ),
|
|
127
124
|
} );
|
|
128
125
|
const query = {
|
|
129
|
-
offset: perPage ? perPage
|
|
126
|
+
offset: perPage ? perPage + offset : 0,
|
|
130
127
|
order,
|
|
131
128
|
orderby: orderBy,
|
|
132
129
|
};
|
|
@@ -194,7 +191,6 @@ export default function PostTemplateEdit( {
|
|
|
194
191
|
},
|
|
195
192
|
[
|
|
196
193
|
perPage,
|
|
197
|
-
page,
|
|
198
194
|
offset,
|
|
199
195
|
order,
|
|
200
196
|
orderBy,
|
package/src/post-terms/edit.js
CHANGED
|
@@ -97,7 +97,6 @@ export default function PostTermsEdit( {
|
|
|
97
97
|
<RichText
|
|
98
98
|
allowedFormats={ ALLOWED_FORMATS }
|
|
99
99
|
className="wp-block-post-terms__prefix"
|
|
100
|
-
multiline={ false }
|
|
101
100
|
aria-label={ __( 'Prefix' ) }
|
|
102
101
|
placeholder={ __( 'Prefix' ) + ' ' }
|
|
103
102
|
value={ prefix }
|
|
@@ -141,7 +140,6 @@ export default function PostTermsEdit( {
|
|
|
141
140
|
<RichText
|
|
142
141
|
allowedFormats={ ALLOWED_FORMATS }
|
|
143
142
|
className="wp-block-post-terms__suffix"
|
|
144
|
-
multiline={ false }
|
|
145
143
|
aria-label={ __( 'Suffix' ) }
|
|
146
144
|
placeholder={ ' ' + __( 'Suffix' ) }
|
|
147
145
|
value={ suffix }
|
|
@@ -34,10 +34,7 @@ const transforms = {
|
|
|
34
34
|
type: 'block',
|
|
35
35
|
blocks: [ 'core/paragraph' ],
|
|
36
36
|
transform: ( attributes ) =>
|
|
37
|
-
createBlock( 'core/paragraph',
|
|
38
|
-
...attributes,
|
|
39
|
-
content: attributes.content.replace( /\n/g, '<br>' ),
|
|
40
|
-
} ),
|
|
37
|
+
createBlock( 'core/paragraph', attributes ),
|
|
41
38
|
},
|
|
42
39
|
{
|
|
43
40
|
type: 'block',
|
|
@@ -131,6 +131,7 @@ export default function QueryContent( {
|
|
|
131
131
|
<InspectorControls group="advanced">
|
|
132
132
|
<SelectControl
|
|
133
133
|
__nextHasNoMarginBottom
|
|
134
|
+
__next40pxDefaultSize
|
|
134
135
|
label={ __( 'HTML element' ) }
|
|
135
136
|
options={ [
|
|
136
137
|
{ label: __( 'Default (<div>)' ), value: 'div' },
|
package/src/query/index.php
CHANGED
|
@@ -44,7 +44,11 @@ function render_block_core_query( $attributes, $content, $block ) {
|
|
|
44
44
|
$block->block_type->supports['interactivity'] = true;
|
|
45
45
|
|
|
46
46
|
// Add a div to announce messages using `aria-live`.
|
|
47
|
-
$
|
|
47
|
+
$html_tag = 'div';
|
|
48
|
+
if ( ! empty( $attributes['tagName'] ) ) {
|
|
49
|
+
$html_tag = esc_attr( $attributes['tagName'] );
|
|
50
|
+
}
|
|
51
|
+
$last_tag_position = strripos( $content, '</' . $html_tag . '>' );
|
|
48
52
|
$content = substr_replace(
|
|
49
53
|
$content,
|
|
50
54
|
'<div
|
|
@@ -57,7 +61,7 @@ function render_block_core_query( $attributes, $content, $block ) {
|
|
|
57
61
|
data-wp-class--start-animation="selectors.core.query.startAnimation"
|
|
58
62
|
data-wp-class--finish-animation="selectors.core.query.finishAnimation"
|
|
59
63
|
></div>',
|
|
60
|
-
$
|
|
64
|
+
$last_tag_position,
|
|
61
65
|
0
|
|
62
66
|
);
|
|
63
67
|
}
|
package/src/quote/block.json
CHANGED
package/src/quote/style.scss
CHANGED
package/src/read-more/style.scss
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import {
|
|
6
6
|
BlockSettingsMenuControls,
|
|
7
|
-
BlockTitle,
|
|
8
7
|
useBlockProps,
|
|
9
8
|
Warning,
|
|
10
9
|
store as blockEditorStore,
|
|
@@ -14,7 +13,7 @@ import {
|
|
|
14
13
|
import { Spinner, Modal, MenuItem } from '@wordpress/components';
|
|
15
14
|
import { __, sprintf } from '@wordpress/i18n';
|
|
16
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
17
|
-
import { useState
|
|
16
|
+
import { useState } from '@wordpress/element';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Internal dependencies
|
|
@@ -35,7 +34,11 @@ export default function TemplatePartEdit( {
|
|
|
35
34
|
setAttributes,
|
|
36
35
|
clientId,
|
|
37
36
|
} ) {
|
|
38
|
-
const
|
|
37
|
+
const currentTheme = useSelect(
|
|
38
|
+
( select ) => select( coreStore ).getCurrentTheme()?.stylesheet,
|
|
39
|
+
[]
|
|
40
|
+
);
|
|
41
|
+
const { slug, theme = currentTheme, tagName, layout = {} } = attributes;
|
|
39
42
|
const templatePartId = createTemplatePartId( theme, slug );
|
|
40
43
|
const hasAlreadyRendered = useHasRecursion( templatePartId );
|
|
41
44
|
const [ isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen ] =
|
|
@@ -174,17 +177,7 @@ export default function TemplatePartEdit( {
|
|
|
174
177
|
}
|
|
175
178
|
aria-haspopup="dialog"
|
|
176
179
|
>
|
|
177
|
-
{
|
|
178
|
-
__( 'Replace <BlockTitle />' ),
|
|
179
|
-
{
|
|
180
|
-
BlockTitle: (
|
|
181
|
-
<BlockTitle
|
|
182
|
-
clientId={ clientId }
|
|
183
|
-
maximumLength={ 25 }
|
|
184
|
-
/>
|
|
185
|
-
),
|
|
186
|
-
}
|
|
187
|
-
) }
|
|
180
|
+
{ __( 'Replace' ) }
|
|
188
181
|
</MenuItem>
|
|
189
182
|
);
|
|
190
183
|
} }
|
|
@@ -32,10 +32,11 @@ export const settings = {
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const { getCurrentTheme, getEntityRecord } = select( coreDataStore );
|
|
36
|
+
const entity = getEntityRecord(
|
|
36
37
|
'postType',
|
|
37
38
|
'wp_template_part',
|
|
38
|
-
theme + '//' + slug
|
|
39
|
+
( theme || getCurrentTheme()?.stylesheet ) + '//' + slug
|
|
39
40
|
);
|
|
40
41
|
if ( ! entity ) {
|
|
41
42
|
return;
|
|
@@ -60,7 +61,7 @@ export const init = () => {
|
|
|
60
61
|
const DISALLOWED_PARENTS = [ 'core/post-template', 'core/post-content' ];
|
|
61
62
|
addFilter(
|
|
62
63
|
'blockEditor.__unstableCanInsertBlockType',
|
|
63
|
-
'removeTemplatePartsFromPostTemplates',
|
|
64
|
+
'core/block-library/removeTemplatePartsFromPostTemplates',
|
|
64
65
|
(
|
|
65
66
|
canInsert,
|
|
66
67
|
blockType,
|
|
@@ -43,10 +43,10 @@ function render_block_core_template_part( $attributes ) {
|
|
|
43
43
|
if ( $template_part_post ) {
|
|
44
44
|
// A published post might already exist if this template part was customized elsewhere
|
|
45
45
|
// or if it's part of a customized template.
|
|
46
|
-
$
|
|
47
|
-
$
|
|
48
|
-
if (
|
|
49
|
-
$area = $
|
|
46
|
+
$block_template = _build_block_template_result_from_post( $template_part_post );
|
|
47
|
+
$content = $block_template->content;
|
|
48
|
+
if ( isset( $block_template->area ) ) {
|
|
49
|
+
$area = $block_template->area;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Fires when a block template part is loaded from a template post stored in the database.
|
|
@@ -35,10 +35,12 @@ export function enhanceTemplatePartVariations( settings, name ) {
|
|
|
35
35
|
// Find a matching variation from the created template part
|
|
36
36
|
// by checking the entity's `area` property.
|
|
37
37
|
if ( ! slug ) return false;
|
|
38
|
-
const
|
|
38
|
+
const { getCurrentTheme, getEntityRecord } =
|
|
39
|
+
select( coreDataStore );
|
|
40
|
+
const entity = getEntityRecord(
|
|
39
41
|
'postType',
|
|
40
42
|
'wp_template_part',
|
|
41
|
-
`${ theme }//${ slug }`
|
|
43
|
+
`${ theme || getCurrentTheme()?.stylesheet }//${ slug }`
|
|
42
44
|
);
|
|
43
45
|
|
|
44
46
|
if ( entity?.slug ) {
|