Skip to content

Instantly share code, notes, and snippets.

@bgrgicak
Last active December 11, 2024 12:42
Show Gist options
  • Save bgrgicak/481009de258e3c0e58c6be48564b4e30 to your computer and use it in GitHub Desktop.
Save bgrgicak/481009de258e3c0e58c6be48564b4e30 to your computer and use it in GitHub Desktop.
WordPress Playground for developers Workshop

WordPress Playground for developers Workshop

Links

Notes

Playground Website

https://playground.wordpress.net/

  • New temp site with custom settings
    • PHP version 8.1
    • Language
    • Enable networking

Query API

https://wordpress.github.io/wordpress-playground/developers/apis/query-api

  • Enable networking
?networking=yes
  • Install plugin
&plugin=maintenance
  • Install theme
&theme=fictionary
  • Update page content
A yellow site

Persisting data

  • Save site
  • Export
https://github.com/bgrgicak/WordPress-Playground-for-developers-Workshop
  • Backup repository
https://github.com/bgrgicak/WordPress-Playground-for-developers-Workshop-backup
  • Import
/wp-content

Blueprints

hr
  • Install plugin
maintenance
  • Install theme
https://github.com/Automattic/themes/tree/trunk/fictionary
https://github-proxy.com/proxy/?repo=Automattic/themes&branch=trunk&directory=/fictionary/
  • Set blog name
  • Insert post
  • Share link to final Blueprint using a Gist
https://gist.github.com/bgrgicak/481009de258e3c0e58c6be48564b4e30
https://playground.wordpress.net/?blueprint-url=https://gist.githubusercontent.com/bgrgicak/481009de258e3c0e58c6be48564b4e30/raw/d7a62f2b29fdf0a8b9926d5d41960dd26bce45ed/workshop-blueprint.json
{
"landingPage": "/we-have-another-post/",
"preferredVersions": {
"php": "8.1",
"wp": "6.7"
},
"features": {
"networking": true
},
"steps": [
{
"step": "login",
"username": "admin"
},
{
"step": "setSiteLanguage",
"language": "hr"
},
{
"step": "installPlugin",
"pluginData": {
"resource": "wordpress.org/plugins",
"slug": "maintenance"
},
"options": {
"activate": true
}
},
{
"step": "installTheme",
"themeData": {
"resource": "url",
"url": "https://github-proxy.com/proxy/?repo=Automattic/themes&branch=trunk&directory=fictionary"
},
"options": {
"activate": true,
"importStarterContent": true
}
},
{
"step": "setSiteOptions",
"options": {
"blogname": " A yellow site",
"blogdescription": "A great blog"
}
},
{
"step": "runPHP",
"code": "<?php require_once 'wordpress/wp-load.php'; wp_insert_post(array('post_title' => 'We have another post', 'post_status' => 'publish')); ?>"
}
]
}
@bgrgicak
Copy link
Author

bgrgicak commented Dec 11, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment