You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request updates the "Quick Start Guide for Developers"
documentation to improve clarity, add practical instructions, and expand
coverage of previewing pull requests and branches in Playground. The
most important changes are grouped below:
**Previewing Pull Requests and Branches:**
* Added detailed instructions for previewing repository code in
Playground using either `git:directory` or direct `.zip` URLs, including
a JSON Blueprint example and explanation of CI requirements.
* Introduced a new section on previewing WordPress Core and Gutenberg
branches or PRs using Query API parameters, with concrete URL examples
for trunk and PR previews.
**Content and Clarity Improvements:**
* Updated the description metadata for the guide to reflect better
coverage of embedding WordPress, installing plugins, previewing PRs, and
using Playground APIs.
* Reworded plugin and theme installation instructions for clarity and
conciseness.
* Revised compatibility testing environment instructions to emphasize
configuring PHP and WordPress versions for plugin testing in Playground.
**Blueprints API Update:**
* Updated the Blueprints API example for importing WXR files to use the
`file` property instead of `pluginData` for resource URLs.
Copy file name to clipboardExpand all lines: packages/docs/site/docs/developers/03-build-an-app/01-index.md
+47-10Lines changed: 47 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
title: Quick Start Guide for Developers
3
3
slug: /developers/build-your-first-app
4
+
description: Practical guide to embedding WordPress, installing plugins, previewing PRs, and building apps with Playground APIs.
4
5
---
5
6
6
7
# Quick Start Guide for Developers
@@ -39,8 +40,7 @@ Learn more about each of these APIs in the [APIs overview section](/developers/a
39
40
40
41
import ThisIsQueryApi from '@site/docs/\_fragments/\_this_is_query_api.md';
41
42
42
-
You can install plugins and themes from the WordPress directory with only URL parameters. For example this iframe would come with the `coblocks` and `friends` plugins preinstalled as well as the `pendant` theme.
43
-
43
+
You can install plugins and themes from the WordPress directory with only URL parameters. This iframe preinstalls the `coblocks` and `friends` plugins and the `pendant` theme.
44
44
<ThisIsQueryApi />
45
45
46
46
```html
@@ -72,7 +72,7 @@ You can still showcase it on Playground by using [JSON Blueprints](/blueprints).
@@ -85,15 +85,44 @@ See [getting started with Blueprints](/blueprints/getting-started) to learn more
85
85
86
86
## Preview pull requests from your repository
87
87
88
-
See the [live example of Gutenberg PR previewer](https://playground.wordpress.net/gutenberg.html).
88
+
You can preview repository code two ways: directly with `git:directory`, or by pointing to a `.zip` from your CI pipeline. Here's the `git:directory` approach using [Blueprints](/blueprints):
89
89
90
-
You can use Playground as a Pull Request previewer if:
90
+
```json
91
+
{
92
+
"steps": [
93
+
{
94
+
"step": "installPlugin",
95
+
"pluginData": {
96
+
"resource": "git:directory",
97
+
"url": "https://github.com/my-user/my-repo",
98
+
"ref": "refs/pull/1/head",
99
+
"refType": "refname"
100
+
},
101
+
"options": {
102
+
"activate": true
103
+
},
104
+
"progress": {
105
+
"caption": "Installing plugin from my-user/my-repo PR #1"
106
+
}
107
+
}
108
+
]
109
+
}
110
+
```
111
+
112
+
In the code above, it will install a plugin from a repository located at the `url`, and the reference to find the branch is `refType`; in this case, it will use `refname`, but it can also use `branch`, `tag`, and `commit`.
113
+
114
+
:::tip
115
+
You can automate this process using the [GitHub Action to generate preview links](/guides/github-action-pr-preview), which will help streamline the process.
116
+
:::
91
117
92
-
- Your WordPress plugin or theme uses a CI pipeline
93
-
- Your CI pipeline bundles your plugin or theme
94
-
- You can expose the zip file generated by your CI pipeline publicly
118
+
Loading a `.zip` file is another alternative for previewing your project. See the [live example of Gutenberg PR previewer](https://playground.wordpress.net/gutenberg.html).
95
119
96
-
Those zip bundles aren't any different from regular WordPress Plugins, which means you can install them in Playground using the [JSON Blueprints](/blueprints) API. Once you exposed an endpoint like https://your-site.com/pull-request-1234.zip, the following Blueprint will do the rest:
120
+
To use Playground as a PR previewer, you need:
121
+
122
+
- A CI pipeline that bundles your plugin or theme
123
+
- Public access to the generated `.zip` file
124
+
125
+
Those zip bundles aren't any different from regular WordPress Plugins, which means you can install them in Playground using the [JSON Blueprints](/blueprints) API. Once you expose an endpoint like https://your-site.com/pull-request-1234.zip, the following Blueprint will do the rest:
97
126
98
127
```json
99
128
{
@@ -154,9 +183,17 @@ blueprint={{
154
183
]
155
184
}} />
156
185
186
+
### Preview WordPress Core and Gutenberg Branches or PRs
187
+
188
+
You can preview specific pull requests from WordPress Core and Gutenberg repositories using Query API parameters. Gutenberg branches also have an alternative to preview them with the parameter `gutenberg-branch`. This is useful for testing the latest trunk changes or specific feature branches without creating a PR.
189
+
190
+
- Preview a specific WordPress Core PR: `https://playground.wordpress.net/?core-pr=9500`
191
+
- Preview a specific Gutenberg PR: `https://playground.wordpress.net/?gutenberg-pr=73010`
192
+
- Preview the Gutenberg trunk branch: `https://playground.wordpress.net/?gutenberg-branch=trunk`
193
+
157
194
## Build a compatibility testing environment
158
195
159
-
A live plugin demo with a configurable PHP and WordPress makes an excellent compatibility testing environment.
196
+
Test your plugin across PHP and WordPress versions by configuring them in Playground. This helps you verify compatibility before release.
160
197
161
198
With the Query API, you'd simply add the `php` and `wp` query parameters to the URL:
0 commit comments