@wordpress/editor 13.3.6 → 13.5.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/components/document-outline/index.js +7 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/page-attributes/check.js +6 -10
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +3 -5
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +9 -6
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +3 -7
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +7 -12
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -7
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +3 -7
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-preview-button/index.js +3 -3
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -4
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +3 -7
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +4 -8
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +3 -7
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +5 -9
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +3 -7
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-schedule/check.js +3 -7
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-sticky/check.js +3 -7
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +12 -9
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +18 -12
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +2 -9
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-title/index.native.js +1 -0
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-visibility/check.js +3 -7
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/theme-support-check/index.js +3 -7
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/store/utils/notice-builder.js +4 -8
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build-module/components/document-outline/index.js +8 -2
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +6 -9
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +4 -6
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +9 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +3 -6
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +7 -11
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -6
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +3 -6
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +3 -2
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -3
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +3 -6
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +4 -7
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +3 -6
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +5 -8
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +3 -6
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-schedule/check.js +3 -6
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-sticky/check.js +3 -6
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +12 -8
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +18 -11
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +2 -8
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-title/index.native.js +1 -0
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-visibility/check.js +3 -6
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +3 -6
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +4 -7
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-style/style-rtl.css +1 -13
- package/build-style/style.css +1 -13
- package/package.json +30 -30
- package/src/components/document-outline/index.js +6 -3
- package/src/components/page-attributes/check.js +3 -12
- package/src/components/page-attributes/order.js +18 -12
- package/src/components/page-attributes/parent.js +41 -41
- package/src/components/post-author/check.js +2 -10
- package/src/components/post-featured-image/index.js +5 -10
- package/src/components/post-locked-modal/index.js +1 -6
- package/src/components/post-pending-status/check.js +2 -10
- package/src/components/post-preview-button/index.js +1 -2
- package/src/components/post-publish-button/index.js +3 -7
- package/src/components/post-publish-button/label.js +2 -10
- package/src/components/post-publish-panel/index.js +3 -11
- package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -10
- package/src/components/post-publish-panel/postpublish.js +3 -8
- package/src/components/post-publish-panel/prepublish.js +2 -10
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-schedule/check.js +2 -10
- package/src/components/post-sticky/check.js +1 -10
- package/src/components/post-taxonomies/flat-term-selector.js +14 -34
- package/src/components/post-taxonomies/hierarchical-term-selector.js +15 -37
- package/src/components/post-taxonomies/most-used-terms.js +15 -18
- package/src/components/post-title/index.native.js +1 -0
- package/src/components/post-visibility/check.js +2 -10
- package/src/components/theme-support-check/index.js +1 -6
- package/src/store/utils/notice-builder.js +2 -7
- package/src/style.scss +0 -1
- package/src/components/page-attributes/style.scss +0 -12
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -41,11 +36,8 @@ export default function PostFormatPanel() {
|
|
|
41
36
|
const { currentPostFormat, suggestion } = useSelect( ( select ) => {
|
|
42
37
|
const { getEditedPostAttribute, getSuggestedPostFormat } =
|
|
43
38
|
select( editorStore );
|
|
44
|
-
const supportedFormats =
|
|
45
|
-
select( coreStore ).getThemeSupports()
|
|
46
|
-
[ 'formats' ],
|
|
47
|
-
[]
|
|
48
|
-
);
|
|
39
|
+
const supportedFormats =
|
|
40
|
+
select( coreStore ).getThemeSupports().formats ?? [];
|
|
49
41
|
return {
|
|
50
42
|
currentPostFormat: getEditedPostAttribute( 'format' ),
|
|
51
43
|
suggestion: getSuggestion(
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -90,9 +85,9 @@ class PostPublishPanelPostpublish extends Component {
|
|
|
90
85
|
|
|
91
86
|
render() {
|
|
92
87
|
const { children, isScheduled, post, postType } = this.props;
|
|
93
|
-
const postLabel =
|
|
94
|
-
const viewPostLabel =
|
|
95
|
-
const addNewPostLabel =
|
|
88
|
+
const postLabel = postType?.labels?.singular_name;
|
|
89
|
+
const viewPostLabel = postType?.labels?.view_item;
|
|
90
|
+
const addNewPostLabel = postType?.labels?.add_new_item;
|
|
96
91
|
const link =
|
|
97
92
|
post.status === 'future' ? getFuturePostUrl( post ) : post.link;
|
|
98
93
|
const addLink = addQueryArgs( 'post-new.php', {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -42,11 +37,8 @@ function PostPublishPanelPrepublish( { children } ) {
|
|
|
42
37
|
getEntityRecord( 'root', '__unstableBase', undefined ) || {};
|
|
43
38
|
|
|
44
39
|
return {
|
|
45
|
-
hasPublishAction:
|
|
46
|
-
getCurrentPost(),
|
|
47
|
-
[ '_links', 'wp:action-publish' ],
|
|
48
|
-
false
|
|
49
|
-
),
|
|
40
|
+
hasPublishAction:
|
|
41
|
+
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
|
|
50
42
|
isBeingScheduled: isEditedPostBeingScheduled(),
|
|
51
43
|
isRequestingSiteIcon: isResolving( 'getEntityRecord', [
|
|
52
44
|
'root',
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -26,11 +21,8 @@ export default compose( [
|
|
|
26
21
|
withSelect( ( select ) => {
|
|
27
22
|
const { getCurrentPost, getCurrentPostType } = select( editorStore );
|
|
28
23
|
return {
|
|
29
|
-
hasPublishAction:
|
|
30
|
-
getCurrentPost(),
|
|
31
|
-
[ '_links', 'wp:action-publish' ],
|
|
32
|
-
false
|
|
33
|
-
),
|
|
24
|
+
hasPublishAction:
|
|
25
|
+
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
|
|
34
26
|
postType: getCurrentPostType(),
|
|
35
27
|
};
|
|
36
28
|
} ),
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -26,11 +21,7 @@ export default compose( [
|
|
|
26
21
|
withSelect( ( select ) => {
|
|
27
22
|
const post = select( editorStore ).getCurrentPost();
|
|
28
23
|
return {
|
|
29
|
-
hasStickyAction:
|
|
30
|
-
post,
|
|
31
|
-
[ '_links', 'wp:action-sticky' ],
|
|
32
|
-
false
|
|
33
|
-
),
|
|
24
|
+
hasStickyAction: post._links?.[ 'wp:action-sticky' ] ?? false,
|
|
34
25
|
postType: select( editorStore ).getCurrentPostType(),
|
|
35
26
|
};
|
|
36
27
|
} ),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
4
|
import escapeHtml from 'escape-html';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -37,8 +36,6 @@ const EMPTY_ARRAY = [];
|
|
|
37
36
|
const MAX_TERMS_SUGGESTIONS = 20;
|
|
38
37
|
const DEFAULT_QUERY = {
|
|
39
38
|
per_page: MAX_TERMS_SUGGESTIONS,
|
|
40
|
-
orderby: 'count',
|
|
41
|
-
order: 'desc',
|
|
42
39
|
_fields: 'id,name',
|
|
43
40
|
context: 'view',
|
|
44
41
|
};
|
|
@@ -108,24 +105,14 @@ export function FlatTermSelector( { slug } ) {
|
|
|
108
105
|
|
|
109
106
|
return {
|
|
110
107
|
hasCreateAction: _taxonomy
|
|
111
|
-
?
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
'_links',
|
|
115
|
-
'wp:action-create-' + _taxonomy.rest_base,
|
|
116
|
-
],
|
|
117
|
-
false
|
|
118
|
-
)
|
|
108
|
+
? post._links?.[
|
|
109
|
+
'wp:action-create-' + _taxonomy.rest_base
|
|
110
|
+
] ?? false
|
|
119
111
|
: false,
|
|
120
112
|
hasAssignAction: _taxonomy
|
|
121
|
-
?
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
'_links',
|
|
125
|
-
'wp:action-assign-' + _taxonomy.rest_base,
|
|
126
|
-
],
|
|
127
|
-
false
|
|
128
|
-
)
|
|
113
|
+
? post._links?.[
|
|
114
|
+
'wp:action-assign-' + _taxonomy.rest_base
|
|
115
|
+
] ?? false
|
|
129
116
|
: false,
|
|
130
117
|
taxonomy: _taxonomy,
|
|
131
118
|
termIds: _termIds,
|
|
@@ -241,30 +228,23 @@ export function FlatTermSelector( { slug } ) {
|
|
|
241
228
|
}
|
|
242
229
|
|
|
243
230
|
const newTermIds = [ ...termIds, newTerm.id ];
|
|
231
|
+
const defaultName = slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' );
|
|
244
232
|
const termAddedMessage = sprintf(
|
|
245
233
|
/* translators: %s: term name. */
|
|
246
234
|
_x( '%s added', 'term' ),
|
|
247
|
-
|
|
248
|
-
taxonomy,
|
|
249
|
-
[ 'labels', 'singular_name' ],
|
|
250
|
-
slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' )
|
|
251
|
-
)
|
|
235
|
+
taxonomy?.labels?.singular_name ?? defaultName
|
|
252
236
|
);
|
|
253
237
|
|
|
254
238
|
speak( termAddedMessage, 'assertive' );
|
|
255
239
|
onUpdateTerms( newTermIds );
|
|
256
240
|
}
|
|
257
241
|
|
|
258
|
-
const newTermLabel =
|
|
259
|
-
taxonomy
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
taxonomy,
|
|
265
|
-
[ 'labels', 'singular_name' ],
|
|
266
|
-
slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' )
|
|
267
|
-
);
|
|
242
|
+
const newTermLabel =
|
|
243
|
+
taxonomy?.labels?.add_new_item ??
|
|
244
|
+
( slug === 'post_tag' ? __( 'Add new tag' ) : __( 'Add new Term' ) );
|
|
245
|
+
const singularName =
|
|
246
|
+
taxonomy?.labels?.singular_name ??
|
|
247
|
+
( slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' ) );
|
|
268
248
|
const termAddedLabel = sprintf(
|
|
269
249
|
/* translators: %s: term name. */
|
|
270
250
|
_x( '%s added', 'term' ),
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -180,27 +175,18 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
180
175
|
const { getTaxonomy, getEntityRecords, isResolving } =
|
|
181
176
|
select( coreStore );
|
|
182
177
|
const _taxonomy = getTaxonomy( slug );
|
|
178
|
+
const post = getCurrentPost();
|
|
183
179
|
|
|
184
180
|
return {
|
|
185
181
|
hasCreateAction: _taxonomy
|
|
186
|
-
?
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
'_links',
|
|
190
|
-
'wp:action-create-' + _taxonomy.rest_base,
|
|
191
|
-
],
|
|
192
|
-
false
|
|
193
|
-
)
|
|
182
|
+
? post._links?.[
|
|
183
|
+
'wp:action-create-' + _taxonomy.rest_base
|
|
184
|
+
] ?? false
|
|
194
185
|
: false,
|
|
195
186
|
hasAssignAction: _taxonomy
|
|
196
|
-
?
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
'_links',
|
|
200
|
-
'wp:action-assign-' + _taxonomy.rest_base,
|
|
201
|
-
],
|
|
202
|
-
false
|
|
203
|
-
)
|
|
187
|
+
? post._links?.[
|
|
188
|
+
'wp:action-assign-' + _taxonomy.rest_base
|
|
189
|
+
] ?? false
|
|
204
190
|
: false,
|
|
205
191
|
terms: _taxonomy
|
|
206
192
|
? getEditedPostAttribute( _taxonomy.rest_base )
|
|
@@ -308,14 +294,12 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
308
294
|
parent: formParent ? formParent : undefined,
|
|
309
295
|
} );
|
|
310
296
|
|
|
297
|
+
const defaultName =
|
|
298
|
+
slug === 'category' ? __( 'Category' ) : __( 'Term' );
|
|
311
299
|
const termAddedMessage = sprintf(
|
|
312
300
|
/* translators: %s: taxonomy name */
|
|
313
301
|
_x( '%s added', 'term' ),
|
|
314
|
-
|
|
315
|
-
taxonomy,
|
|
316
|
-
[ 'labels', 'singular_name' ],
|
|
317
|
-
slug === 'category' ? __( 'Category' ) : __( 'Term' )
|
|
318
|
-
)
|
|
302
|
+
taxonomy?.labels?.singular_name ?? defaultName
|
|
319
303
|
);
|
|
320
304
|
speak( termAddedMessage, 'assertive' );
|
|
321
305
|
setAdding( false );
|
|
@@ -383,11 +367,9 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
383
367
|
fallbackIsCategory,
|
|
384
368
|
fallbackIsNotCategory
|
|
385
369
|
) =>
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory
|
|
390
|
-
);
|
|
370
|
+
taxonomy?.labels?.[ labelProperty ] ??
|
|
371
|
+
( slug === 'category' ? fallbackIsCategory : fallbackIsNotCategory );
|
|
372
|
+
|
|
391
373
|
const newTermButtonLabel = labelWithFallback(
|
|
392
374
|
'add_new_item',
|
|
393
375
|
__( 'Add new category' ),
|
|
@@ -405,12 +387,8 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
405
387
|
);
|
|
406
388
|
const noParentOption = `— ${ parentSelectLabel } —`;
|
|
407
389
|
const newTermSubmitLabel = newTermButtonLabel;
|
|
408
|
-
const filterLabel =
|
|
409
|
-
|
|
410
|
-
[ 'labels', 'search_items' ],
|
|
411
|
-
__( 'Search Terms' )
|
|
412
|
-
);
|
|
413
|
-
const groupLabel = get( taxonomy, [ 'name' ], __( 'Terms' ) );
|
|
390
|
+
const filterLabel = taxonomy?.labels?.search_items ?? __( 'Search Terms' );
|
|
391
|
+
const groupLabel = taxonomy?.name ?? __( 'Terms' );
|
|
414
392
|
const showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER;
|
|
415
393
|
|
|
416
394
|
return (
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -26,24 +21,26 @@ const DEFAULT_QUERY = {
|
|
|
26
21
|
};
|
|
27
22
|
|
|
28
23
|
export default function MostUsedTerms( { onSelect, taxonomy } ) {
|
|
29
|
-
const { _terms, showTerms } = useSelect(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
const { _terms, showTerms } = useSelect(
|
|
25
|
+
( select ) => {
|
|
26
|
+
const mostUsedTerms = select( coreStore ).getEntityRecords(
|
|
27
|
+
'taxonomy',
|
|
28
|
+
taxonomy.slug,
|
|
29
|
+
DEFAULT_QUERY
|
|
30
|
+
);
|
|
31
|
+
return {
|
|
32
|
+
_terms: mostUsedTerms,
|
|
33
|
+
showTerms: mostUsedTerms?.length >= MIN_MOST_USED_TERMS,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
[ taxonomy.slug ]
|
|
37
|
+
);
|
|
40
38
|
|
|
41
39
|
if ( ! showTerms ) {
|
|
42
40
|
return null;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
const terms = unescapeTerms( _terms );
|
|
46
|
-
const label = get( taxonomy, [ 'labels', 'most_used' ] );
|
|
47
44
|
|
|
48
45
|
return (
|
|
49
46
|
<div className="editor-post-taxonomies__flat-term-most-used">
|
|
@@ -51,7 +48,7 @@ export default function MostUsedTerms( { onSelect, taxonomy } ) {
|
|
|
51
48
|
as="h3"
|
|
52
49
|
className="editor-post-taxonomies__flat-term-most-used-label"
|
|
53
50
|
>
|
|
54
|
-
{
|
|
51
|
+
{ taxonomy.labels.most_used }
|
|
55
52
|
</BaseControl.VisualLabel>
|
|
56
53
|
{ /*
|
|
57
54
|
* Disable reason: The `list` ARIA role is redundant but
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -23,11 +18,8 @@ export default compose( [
|
|
|
23
18
|
withSelect( ( select ) => {
|
|
24
19
|
const { getCurrentPost, getCurrentPostType } = select( editorStore );
|
|
25
20
|
return {
|
|
26
|
-
hasPublishAction:
|
|
27
|
-
getCurrentPost(),
|
|
28
|
-
[ '_links', 'wp:action-publish' ],
|
|
29
|
-
false
|
|
30
|
-
),
|
|
21
|
+
hasPublishAction:
|
|
22
|
+
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
|
|
31
23
|
postType: getCurrentPostType(),
|
|
32
24
|
};
|
|
33
25
|
} ),
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -23,7 +18,7 @@ export function ThemeSupportCheck( {
|
|
|
23
18
|
const isSupported = (
|
|
24
19
|
Array.isArray( supportKeys ) ? supportKeys : [ supportKeys ]
|
|
25
20
|
).some( ( key ) => {
|
|
26
|
-
const supported =
|
|
21
|
+
const supported = themeSupports?.[ key ] ?? false;
|
|
27
22
|
// 'post-thumbnails' can be boolean or an array of post types.
|
|
28
23
|
// In the latter case, we need to verify `postType` exists
|
|
29
24
|
// within `supported`. If `postType` isn't passed, then the check
|
|
@@ -8,11 +8,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
8
8
|
*/
|
|
9
9
|
import { SAVE_POST_NOTICE_ID, TRASH_POST_NOTICE_ID } from '../constants';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* External dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { get } from 'lodash';
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* Builds the arguments for a success notification dispatch.
|
|
18
13
|
*
|
|
@@ -24,7 +19,7 @@ import { get } from 'lodash';
|
|
|
24
19
|
export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
25
20
|
const { previousPost, post, postType } = data;
|
|
26
21
|
// Autosaves are neither shown a notice nor redirected.
|
|
27
|
-
if (
|
|
22
|
+
if ( data.options?.isAutosave ) {
|
|
28
23
|
return [];
|
|
29
24
|
}
|
|
30
25
|
|
|
@@ -38,7 +33,7 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
|
38
33
|
const willPublish = publishStatus.includes( post.status );
|
|
39
34
|
|
|
40
35
|
let noticeMessage;
|
|
41
|
-
let shouldShowLink =
|
|
36
|
+
let shouldShowLink = postType?.viewable ?? false;
|
|
42
37
|
let isDraft;
|
|
43
38
|
|
|
44
39
|
// Always should a notice, which will be spoken for accessibility.
|
package/src/style.scss
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@import "./components/editor-notices/style.scss";
|
|
4
4
|
@import "./components/entities-saved-states/style.scss";
|
|
5
5
|
@import "./components/error-boundary/style.scss";
|
|
6
|
-
@import "./components/page-attributes/style.scss";
|
|
7
6
|
@import "./components/post-excerpt/style.scss";
|
|
8
7
|
@import "./components/post-featured-image/style.scss";
|
|
9
8
|
@import "./components/post-format/style.scss";
|