nextpress-core 3.2.0 → 3.2.1
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.
|
@@ -61,13 +61,13 @@ export async function mapField(field: NextpressField, rawValues: ACFRawValues):
|
|
|
61
61
|
case 'oembed':
|
|
62
62
|
case 'wysiwyg':
|
|
63
63
|
case 'file':
|
|
64
|
-
case 'image':
|
|
65
64
|
return rawValues.get(field.name);
|
|
66
65
|
|
|
67
66
|
/**
|
|
68
67
|
* Numeric fields.
|
|
69
68
|
* Casts the raw string from the database into a strict JavaScript Number.
|
|
70
69
|
*/
|
|
70
|
+
case 'image':
|
|
71
71
|
case 'number':
|
|
72
72
|
case 'range':
|
|
73
73
|
return Number(rawValues.get(field.name));
|
|
@@ -146,13 +146,13 @@ export async function mapField(field: NextpressField, rawValues: ACFRawValues):
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Gallery field.
|
|
149
|
-
* Deserializes the PHP array of image IDs
|
|
149
|
+
* Deserializes the PHP array of image IDs.
|
|
150
150
|
*/
|
|
151
151
|
case 'gallery':
|
|
152
152
|
const galleryValues = parsePhp(rawValues.get(field.name));
|
|
153
153
|
if (!Array.isArray(galleryValues)) return;
|
|
154
154
|
|
|
155
|
-
return galleryValues;
|
|
155
|
+
return galleryValues.map(image => Number(image)).filter(Boolean);
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
158
|
* Flexible Content field.
|