133 lines
4.0 KiB
HTML
133 lines
4.0 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 onclick="loadSingleSite()">Single Site</button>
|
|
<button onclick="loadMultisite()">Multisite</button>
|
|
</div>
|
|
<iframe id="playground" src="about:blank"></iframe>
|
|
|
|
<script>
|
|
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,
|
|
"steps": [
|
|
{
|
|
"step": "defineWpConfigConsts",
|
|
"consts": {
|
|
"WP_DEBUG": true
|
|
}
|
|
},
|
|
{
|
|
"step": "installPlugin",
|
|
"pluginData": {
|
|
"resource": "wordpress.org/plugins",
|
|
"slug": "plugin-toggle"
|
|
}
|
|
},
|
|
{
|
|
"step": "installPlugin",
|
|
"pluginData": {
|
|
"resource": "wordpress.org/plugins",
|
|
"slug": "hello-dolly"
|
|
}
|
|
},
|
|
{
|
|
"step": "wp-cli",
|
|
"command": "wp plugin activate hello-dolly"
|
|
}
|
|
]
|
|
};
|
|
|
|
// 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 --activate-network"
|
|
},
|
|
{
|
|
"step": "installPlugin",
|
|
"pluginData": {
|
|
"resource": "wordpress.org/plugins",
|
|
"slug": "hello-dolly"
|
|
}
|
|
},
|
|
{
|
|
"step": "wp-cli",
|
|
"command": "wp plugin activate hello-dolly --network"
|
|
}
|
|
]
|
|
};
|
|
|
|
// Load single site by default
|
|
loadSingleSite();
|
|
</script>
|
|
</body>
|
|
</html>
|