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

Docs/Guides: WordPress Playground for theme developers #1732

Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
be65fc9
add tips to using URL fragments to load blueprints
juanmaguitar Sep 6, 2024
9aef47a
guide for theme developers - initial commit
juanmaguitar Sep 6, 2024
af20b4a
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 6, 2024
cd40e73
finished setting up a demo and Local Theme Development with Playground
juanmaguitar Sep 9, 2024
a6599e3
Merge branch 'docs/guide-for-theme-developers' of github.com:wordpres…
juanmaguitar Sep 9, 2024
eb220e1
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 9, 2024
74e55fa
Design your theme using the WordPress UI and save your changes as Pul…
juanmaguitar Sep 9, 2024
8dc1de2
grammar check
juanmaguitar Sep 9, 2024
c1c2714
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 9, 2024
b701218
Justin's feedback addressed
juanmaguitar Sep 10, 2024
97c9089
Merge branch 'docs/guide-for-theme-developers' of github.com:wordpres…
juanmaguitar Sep 10, 2024
4a4041f
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 10, 2024
7fb8d82
Reference to example for block theme developers
juanmaguitar Sep 10, 2024
5137274
Merge branch 'docs/guide-for-theme-developers' of github.com:wordpres…
juanmaguitar Sep 10, 2024
db85ad7
Importing content for your demo and live demo links
juanmaguitar Sep 10, 2024
299d662
Fine tuned content Guide
juanmaguitar Sep 10, 2024
190c209
wp-cli
juanmaguitar Sep 11, 2024
d4dfcb0
more wp-cli use cases
juanmaguitar Sep 11, 2024
4b06bbb
Extracted providing content for your demo
juanmaguitar Sep 11, 2024
305b75c
Added reference to "Providing content for your demo" guide
juanmaguitar Sep 11, 2024
b62430d
Shorter sentence
juanmaguitar Sep 11, 2024
71aee09
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 11, 2024
53255a4
Merge branch 'trunk' into docs/guide-for-theme-developers
juanmaguitar Sep 12, 2024
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
23 changes: 21 additions & 2 deletions packages/docs/site/docs/main/guides/for-theme-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ Some useful tools and resources provided by the Playground project to work with

Through properties and [`steps`](/blueprints/steps) in the blueprint, you can configure the initial setup of your theme in the Playground instance.

### Importing content for your demo
### Providing content for your demo

One of the things you may want to do to provide a good demo of your theme via Playground is to load default content to better highlight the features of your theme. This default content may include images or other assets.
Copy link
Collaborator

@bph bph Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first sentence seems a bit long. See if this tightens it up a bit.
"To provide a good demo of your theme via Playground, you may want to load it with default content that highlights the features of your theme. "

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion!

I have extracted the whole "Providing content for your demo" section into a new guide (see #1747) to reference this content from both the "Playground for theme developers" and "Playground for plugin developers" guides.

I have updated this PR with your suggested shorter version in the info callout referencing the "Providing content for your demo" guide


There are several blueprint steps and strategies you can use to import content in the theme you want to display in the Playground instance:
There are several blueprint steps and strategies you can use to import content (or generate it) in the theme you want to display in the Playground instance:

#### `importWxr`

Expand Down Expand Up @@ -198,6 +198,25 @@ With the [`importThemeStarterContent` step](/blueprints/steps#importThemeStarter

You can also publish the starter content of a theme when installing it with the [`installTheme` step](/blueprints/steps#installTheme) by setting to `true` its `importStarterContent` option.

#### `wp-cli`

Another way of generating content for your theme is via the `wp-cli` step that allows you to run [WP-CLI commands](https://developer.wordpress.org/cli/commands/) such as [`wp post generate`](https://developer.wordpress.org/cli/commands/post/generate/):

```json
{
"landingPage": "/wp-admin/edit.php",
"login": true,
"steps": [
{
"step": "wp-cli",
"command": "wp post generate --count=20 --post_type=post --post_date=1999-01-04"
}
]
}
```

[<kbd> &nbsp; Run Blueprint &nbsp; </kbd>](https://playground.wordpress.net/builder/builder.html#{%22landingPage%22:%22/wp-admin/edit.php%22,%22login%22:true,%22steps%22:[{%22step%22:%22wp-cli%22,%22command%22:%22wp%20post%20generate%20--count=20%20--post_type=post%20--post_date=1999-01-04%22}]})

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also link to the Blueprint Gallery entry of https://github.com/WordPress/blueprints/tree/trunk/blueprints/wpcli-post-with-image
The shows the connection between content and featured image.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a tip referencing that example

### Other Settings

#### `resetData`
Expand Down
Loading