Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples and demos in the docs #1107

Merged
merged 5 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix JSON markup
  • Loading branch information
ironnysh committed Mar 16, 2024
commit 07615a20a0d19e2e3921e668e64167f50201cceb
43 changes: 36 additions & 7 deletions packages/docs/site/docs/09-blueprints-api/08-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ blueprint={{

## Enable PHP extensions and networking

<BlueprintExample blueprint={{
{
<BlueprintExample display={`{
"landingPage": "/wp-admin/plugin-install.php",
"phpExtensionBundles": [
"kitchen-sink"
Expand All @@ -131,15 +130,27 @@ blueprint={{
"step": "login"
}
]
}
}`}
blueprint={{
"landingPage": "/wp-admin/plugin-install.php",
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
"networking": true
},
"steps": [
{
"step": "login"
}
]
}} />

## Load PHP code on every request (mu-plugin)

use the `writeFile` step to add code to a mu-plugin that runs on every request.
Use the `writeFile` step to add code to a mu-plugin that runs on every request.

<BlueprintExample blueprint={{
{
<BlueprintExample display={`{
"landingPage": "/category/uncategorized/",
"phpExtensionBundles": [
"kitchen-sink"
Expand All @@ -157,7 +168,25 @@ use the `writeFile` step to add code to a mu-plugin that runs on every request.
"data": "<?php add_action( 'after_setup_theme', function() { global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%postname%/'); $wp_rewrite->flush_rules(); } );"
}
]
}
}`}
blueprint={{
"landingPage": "/category/uncategorized/",
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
"networking": true
},
"steps": [
{
"step": "login"
},
{
"step": "writeFile",
"path": "/wordpress/wp-content/mu-plugins/rewrite.php",
"data": "<?php add_action( 'after_setup_theme', function() { global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%postname%/'); $wp_rewrite->flush_rules(); } );"
}
]
}} />

You can share your own Blueprint examples in [this dedicated wiki](https://github.com/WordPress/wordpress-playground/wiki/Blueprint-examples).