Skip to content

Commit 0a403dd

Browse files
authored
Merge branch 'develop' into fix/properly-pass-abort-signal
2 parents 4246309 + 260fc79 commit 0a403dd

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

components/content-picker/SortableList.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,23 @@ const SortableList: React.FC<SortableListProps> = ({
9797
const { getEntityRecord, hasFinishedResolution } = select(coreStore);
9898

9999
return posts.reduce<{ [key: string]: PickedItemType | null }>((acc, item) => {
100-
const getEntityRecordParameters = [entityKind, item.type, item.id] as const;
100+
const fields = ['link', 'type', 'id'];
101+
if (mode === 'user') {
102+
fields.push('name');
103+
} else if (mode === 'post') {
104+
fields.push('title');
105+
fields.push('url');
106+
fields.push('subtype');
107+
} else {
108+
fields.push('name');
109+
fields.push('taxonomy');
110+
}
111+
const getEntityRecordParameters = [
112+
entityKind,
113+
item.type,
114+
item.id,
115+
{ _fields: fields },
116+
] as const;
101117
const result = getEntityRecord<Post | Term | User>(...getEntityRecordParameters);
102118

103119
if (result) {

components/content-search/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const prepareSearchQuery = ({
5151
case 'user':
5252
searchQuery = addQueryArgs('wp/v2/users', {
5353
search: keyword,
54+
_fields: ['id', 'link', 'url', 'type', 'name', 'subtype'],
5455
});
5556
break;
5657
default:
@@ -61,6 +62,7 @@ export const prepareSearchQuery = ({
6162
_embed: true,
6263
per_page: perPage,
6364
page,
65+
_fields: ['id', 'link', 'url', 'type', 'title', 'subtype'],
6466
});
6567

6668
break;

example/.wp-env.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"plugins": [ ".", "https://downloads.wordpress.org/plugin/wordpress-seo.21.9.1.zip" ],
2+
"plugins": [ ".", "https://downloads.wordpress.org/plugin/wordpress-seo.24.6.zip" ],
33
"mappings": {
44
"/var/www/html/images": "./images"
55
}

0 commit comments

Comments
 (0)