Files
wp-plugin-starter-template-…/playground/test.html
Marcus Quinn 6625e8ca4a fix: disable networking in singleSiteBlueprint to prevent multisite (#48)
Set networking to false in the single site playground blueprint.
Networking: true can inadvertently enable multisite behaviour.

Closes #39
2026-03-16 21:45:24 +00:00

121 lines
3.6 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WordPress Playground Test</title>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: none;
}
.buttons {
position: fixed;
top: 10px;
left: 10px;
z-index: 1000;
}
button {
padding: 10px;
margin-right: 10px;
background-color: #0073aa;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #005177;
}
</style>
</head>
<body>
<div class="buttons">
<button type="button" id="singleSiteBtn">Single Site</button>
<button type="button" id="multisiteBtn">Multisite</button>
</div>
<iframe id="playground" src="about:blank" title="WordPress Playground Test Environment"></iframe>
<script>
// Use unobtrusive event listeners instead of inline handlers
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('singleSiteBtn').addEventListener('click', loadSingleSite);
document.getElementById('multisiteBtn').addEventListener('click', loadMultisite);
});
function loadSingleSite() {
document.getElementById('playground').src = "https://playground.wordpress.net/?blueprint=" + encodeURIComponent(JSON.stringify(singleSiteBlueprint));
}
function loadMultisite() {
document.getElementById('playground').src = "https://playground.wordpress.net/?blueprint=" + encodeURIComponent(JSON.stringify(multisiteBlueprint));
}
// Single site blueprint
const singleSiteBlueprint = {
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/",
"login": true,
"features": {
"networking": false
},
"steps": [
{
"step": "defineWpConfigConsts",
"consts": {
"WP_DEBUG": true
}
},
{
"step": "wp-cli",
"command": "wp plugin install plugin-toggle kadence-blocks --activate"
}
]
};
// Multisite blueprint
const multisiteBlueprint = {
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/network/",
"login": true,
"features": {
"networking": true
},
"steps": [
{
"step": "defineWpConfigConsts",
"consts": {
"WP_DEBUG": true
}
},
{
"step": "enableMultisite"
},
{
"step": "wp-cli",
"command": "wp site create --slug=testsite"
},
{
"step": "wp-cli",
"command": "wp plugin install plugin-toggle kadence-blocks --activate-network"
}
]
};
// Load single site by default
loadSingleSite();
</script>
</body>
</html>