Skip to content

Commit c85dab0

Browse files
authored
Allow installing multiple themes via URL, as required by parent/child themes. (#2581)
## Motivation for the change, related issues At present it isn't possible to install Child themes via the playground through the URL without using a blueprint. ## Implementation details Iterate over the theme parameter. ## Testing Instructions (or ideally a Blueprint) Compare http://127.0.0.1:5400/website-server/?theme=acai&theme=skincare-brand&url=wp-admin/themes.php to http://playground.wordpress.net/?theme=acai&theme=skincare-brand&url=wp-admin/themes.php
1 parent ace3012 commit c85dab0

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

packages/playground/website/src/lib/state/url/resolve-blueprint-from-url.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,21 @@ export async function resolveBlueprintFromURL(
102102
url: query.get('import-site')!,
103103
},
104104
} as StepDefinition),
105-
query.get('theme') &&
106-
({
107-
step: 'installTheme',
108-
themeData: {
109-
resource: 'wordpress.org/themes',
110-
slug: query.get('theme')!,
111-
},
112-
progress: { weight: 2 },
113-
} as StepDefinition),
105+
...query.getAll('theme').map(
106+
(theme, index, themes) =>
107+
({
108+
step: 'installTheme',
109+
themeData: {
110+
resource: 'wordpress.org/themes',
111+
slug: theme,
112+
},
113+
options: {
114+
// Activate only the last theme in the list.
115+
activate: index === themes.length - 1,
116+
},
117+
progress: { weight: 2 },
118+
} as StepDefinition)
119+
),
114120
].filter(Boolean),
115121
};
116122
source = {

0 commit comments

Comments
 (0)