This repository is a WordPress Playground Blueprint Bundle. It opens a generic UC Santa Cruz campus site in the browser. You do not install anything, and each visitor gets a new copy of the site.
This is a proof of concept. Some features do not work. See Known limitations.
| Item | Source |
|---|---|
| UCSC 2022 theme | Latest GitHub release zip |
| UCSC Custom Functionality | Latest GitHub release zip |
| UCSC Blocks | Latest GitHub release zip |
| UCSC Gutenberg Blocks (installed, not activated) | Latest GitHub release zip |
| The Icon Block | wordpress.org |
| Sample pages and posts | content/sample-content.wxr in this repository |
The site runs as a generic campus site. The blueprint does not define UCSC_NEWS_SITE, so the News-only features stay off.
The blueprint imports the sample content first. Then content/setup.php deletes the default "Hello world!" post and the default "Sample Page". It makes Home the front page and Campus News the posts page.
blueprint.json Playground steps
content/sample-content.wxr Sample content, imported by the importWxr step
content/setup.php Cleanup, front page and posts page, run after import
blueprint.json loads both files in content/ as bundled resources. A bundled resource is a file that sits next to the blueprint. Playground fetches bundled files from the folder that holds the blueprint. Thus this repository is the bundle. If you point Playground at the raw blueprint.json, it also gets the files in content/.
Use the raw GitHub URL of blueprint.json. The raw.githubusercontent.com server sends the CORS header that Playground needs.
https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/ucsc/wordpress-blueprints/main/blueprint.json
To pin a version, replace main with a tag or a commit SHA.
Zip the bundle with blueprint.json at the root of the zip:
zip -r ucsc-blueprint.zip blueprint.json contentLoad the zip from New > Blueprint URL in Playground, or give it to the CLI (see Testing changes locally). If you load the zip from a URL, the server must send a CORS header. GitHub does not send this header for release assets.
To link to the campus site from the README of another UCSC repository, add this line:
[Open the UCSC campus site in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/ucsc/wordpress-blueprints/main/blueprint.json)The link always opens the same site. Playground does not know which repository the link is in, so it does not add that repository to the site.
If the repository is the theme or a plugin in What is in it, the site has the latest release of it. The site does not have the code on a branch or a pull request.
If the repository is not in that list, the site does not have it. To add it for every visitor, see Adding a plugin.
The theme, UCSC Custom Functionality, UCSC Blocks, and UCSC Gutenberg Blocks install from the newest release of each repository. The blueprint uses the GitHub address releases/latest/download/<repo>.zip. When a repository publishes a new release, Playground uses it. You do not change this repository.
GitHub sends release files without CORS headers, so the browser blocks the first, direct download from Playground. Playground then fetches the file through its own CORS proxy, and the install succeeds. A live boot with ucsc-2022 v26.10.19 and ucsc-custom-functionality v26.10.7 showed this behavior.
If the release of a UCSC plugin includes a <repo>.zip file, you can add the plugin. The shared ucsc/actions release workflow attaches this file. Add one more step before installTheme, and replace PLUGIN-REPO with the name of the plugin repository:
{
"step": "installPlugin",
"pluginData": {
"resource": "url",
"url": "https://github.com/ucsc/PLUGIN-REPO/releases/latest/download/PLUGIN-REPO.zip"
},
"options": {
"activate": true,
"targetFolderName": "PLUGIN-REPO"
}
}Put each plugin step before the theme step.
If you want the plugin installed but not active, set "activate" to false.
The WXR file holds placeholder text only. To replace the content, do these steps:
- Build the content on a WordPress site. A Playground site is sufficient.
- Export the content from Tools > Export.
- Save the export file over
content/sample-content.wxr.
Follow these rules for the new content:
- If you want
setup.phpto set the front page and the posts page, keep the page slugshomeandcampus-news. Without ahomepage, the script sets neither page. - Write internal links as root-relative paths, for example
href="/about/". Playground serves each site under its own/scope:…path and sends those links to that path. - Do not write a Playground address into the content. The address changes for each visitor.
- Advanced Custom Fields (ACF) PRO is not included. It is licensed, so a public blueprint cannot download it. ACF blocks do not render. This affects the main navigation and the breadcrumbs of the theme, and the blocks of the custom functionality plugin. The ACF options page of the theme is not available.
- The GitHub release zips download through the CORS proxy of Playground. See How the theme and plugins are installed.
- Changes do not persist. If you do not save the site from the Playground menu, your changes disappear when you close the tab.
The Playground CLI needs Node.js 24.18 or later. Run this command from the repository root:
npx @wp-playground/cli@latest server --blueprint=. --blueprint-may-read-adjacent-filesThe CLI does not read bundled files unless you add --blueprint-may-read-adjacent-files.
Open the address that the command prints, usually http://127.0.0.1:9400. You are logged in as admin.
The blueprint can also load your local checkout of the UCSC 2022 theme in place of the release zip. Use this mode to test a theme branch with the plugins and the sample content of this bundle.
Before you start, build the theme branch. The build/ and vendor/ folders are not in the theme repository. Run these commands in your theme checkout:
composer install --no-dev
npm ci
npm run buildThen run this command from the root of this repository. Replace /path/to/ucsc-2022 with the path of your theme checkout:
npx @wp-playground/cli@latest server --blueprint=. --blueprint-may-read-adjacent-files \
--mount=/path/to/ucsc-2022:/wordpress/wp-content/themes/ucsc-2022The --mount option puts your checkout at the theme folder before the blueprint runs. The installTheme step has "ifAlreadyInstalled": "skip", so it does not install the release zip over your checkout. The activateTheme step after it activates the theme in both modes.
Follow these rules:
- The mount target must end in
themes/ucsc-2022. If the folder name is different, Playground installs the release zip next to your checkout, and the site uses the release. - Playground writes to your real files through the mount. Commit or stash your work before the first run.
- To see your edits to PHP, templates, and
theme.json, reload the page. Edits insrc/show only after you runnpm run buildagain, or whilenpm startruns.
To test a plugin branch at the same time, add one more --mount option, for example --mount=/path/to/ucsc-blocks:/wordpress/wp-content/plugins/ucsc-blocks. Before you mount a plugin, add "ifAlreadyInstalled": "skip" to the step of that plugin. Without it, the step can write the release zip over your checkout.