@plaudit/webpack-extensions 2.24.0 → 2.24.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.
|
@@ -160,14 +160,16 @@ class BlockJSONManagingPlugin {
|
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
162
|
let validTemplateLocation, invalidTemplateLocation;
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
163
|
+
if (json["acf"] || (json["plaudit"] && (json["plaudit"] !== "native" && (typeof json["plaudit"] !== 'object' || json["plaudit"]?.["type"] !== "native")))) {
|
|
164
|
+
// ACF-like blocks need to have the template stored in render_template.
|
|
165
|
+
// Because we can statically detect ACF-like blocks, we can make the move here instead of at run-time.
|
|
168
166
|
validTemplateLocation = "render_template";
|
|
169
167
|
invalidTemplateLocation = "render";
|
|
170
168
|
}
|
|
169
|
+
else {
|
|
170
|
+
validTemplateLocation = "render";
|
|
171
|
+
invalidTemplateLocation = "render_template";
|
|
172
|
+
}
|
|
171
173
|
delete json[invalidTemplateLocation];
|
|
172
174
|
json[validTemplateLocation] = renderTemplate.length === 1 ? renderTemplate[0] : renderTemplate;
|
|
173
175
|
}
|