-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
90 lines (83 loc) · 3.21 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Demo Handover Playground</title>
<style>
body {
display: grid;
place-items: center;
background: linear-gradient(deeppink, darkorange);
}
header {
font-size: 1em;
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
display: flex;
align-items: baseline;
gap: 1rem;
}
a {
color: currentcolor;
}
iframe#wp-playground {
width: 95vw;
height: 95vh;
border: 2px solid currentColor;
}
</style>
</head>
<body>
<header>
<h1>Playground Demo</h1>
<p>Source code <a href="https://github.com/wptrainingteam/playground-demo-handover" target="_blank" rel="noopener">on
GitHub</a></p>
</header>
<main>
<iframe id="wp-playground" title="Demo Handover Playground"></iframe>
<script type="module">
import { startPlaygroundWeb } from 'https://playground.wordpress.net/client/index.js';
const client = await startPlaygroundWeb({
iframe: document.getElementById('wp-playground'),
remoteUrl: `https://playground.wordpress.net/remote.html`,
blueprint:
{
"preferredVersions": {
"php": "latest",
"wp": "latest"
},
"siteOptions": {
"blogname": "WordPress Playground Demo"
},
"plugins": [
"create-block-theme"
],
"steps": [
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "url",
"url": "zips/meta-block-sidebar.zip"
}
},
{
"step": "installTheme",
"themeZipFile": {
"resource": "url",
"url": "zips/blue-note.zip"
}
},
{
"step": "runPHP",
"code": "<?php require_once('/wordpress/wp-load.php'); wp_insert_post(array( 'post_title' => 'Created by a Blueprint', 'post_content' => '<!-- wp:paragraph --><p>How do you update the meta fields?</p><!-- /wp:paragraph --><!-- wp:list --><ul><!-- wp:list-item --><li>Open the <strong>Settings</strong> sidebar by clicking the window icon next to the blue <strong>Update</strong> button.</li><!-- /wp:list-item --><!-- wp:list-item --><li>Click the <strong>Meta Block Sidebar</strong> menu (below the <strong>Summary</strong> menu).</li><!-- /wp:list-item --><!-- wp:list-item --><li>Type the <strong>Team name</strong> and the <strong>date</strong> the person joined the company in the respective fields.</li><!-- /wp:list-item --><!-- wp:list-item --><li>Click the blue <strong>Update</strong> button.</li><!-- /wp:list-item --></ul><!-- /wp:list -->','post_status' => 'publish' ));"
}
],
"login": true,
"landingPage": "/?p=4"
},
});
await client.isReady();
</script>
</main>
</body>
</html>