In this Github repository we collect custom blueprint steps for WordPress Playground.
You can then use those custom steps in our Step Builder to create more complex WordPress Playground setups more easily.
You can also use the steps in your own projects by using the npm package.
Comprehensive documentation for all steps is available:
- π Step Documentation - Complete documentation with examples
- π Steps Reference - All steps in one page
- π Individual Steps - Detailed docs for each step
You can tell WordPress Playground what to do before it loads using a Blueprint JSON file. There are a number of builtin steps provided that in combination can make it do powerful things.
Now, this tool collects custom steps that make it easier to specify more complex tasks. The steps get transformed into builtin steps to form a valid, final blueprint that can be executed by WordPress Playground.
In the Step Library UI you can select the steps you want to use by clicking or dragging. On each step you can modify the variables if any. You can also reorder the steps when necessary.
The final blueprint is immediately updated so that you can click the "Launch in Playground" to see if it achieves what you try to do.
To make it easy to share what you are building, the URL of the page is updated with the blueprint. You can copy the URL and share it with others.
You can also share the Playground URL which contains the final blueprint.
Import blueprints:
- Drag & drop any
.jsonblueprint file to import it - Paste Playground URLs - Both hash format and Query API URLs
- Native Playground blueprints are automatically decompiled into custom steps
See Blueprint Import for details.
Try it now from scratch or with a preloaded example.
We welcome contributions! See our Contributing Guide for details on:
- Setting up your development environment
- Creating new steps
- Testing your changes
- Submitting pull requests
The npm package provides a compiler to transform WordPress Playground blueprints with custom steps into blueprints with native steps. It's available as an npm package.
npm install playground-step-libraryimport PlaygroundStepLibrary from 'playground-step-library';
const compiler = new PlaygroundStepLibrary();
const blueprint = {
steps: [
{ step: 'setSiteName', vars: { sitename: 'My Site', tagline: 'A WordPress site' } }
]
};
const v1 = compiler.compile(blueprint); // V1: imperative, with steps array
const v2 = compiler.compileV2(blueprint); // V2: declarative, with schema properties
// Transpile native V1 blueprints to V2 (limited support - see docs)
const result = compiler.transpile(nativeV1Blueprint);See the Programmatic API Documentation for full details on CLI usage, methods, and examples.
This library provides 73 total steps (8 built-in enhanced steps + 65 custom steps):
defineWpConfigConst- Define a wp-config PHP constant.enableMultisite- Enable WordPress Multisite functionality.importWxr- Import a WXR from a URL.installPlugin- Install a plugin via WordPress.org or Git (GitHub, GitLab, Bitbucket, Codeberg, etc.).installTheme- Install a theme via WordPress.org or Git (GitHub, GitLab, Bitbucket, Codeberg, etc.).login- Login to the site.runPHP- Run code in the context of WordPress.setSiteOption- Set a site option.
activatePlugin- Path to the plugin directory as absolute path.activateTheme- The name of the theme folder inside wp-content/themes/.addClientRole- Adds a role for clients with additional capabilities than editors, but not quite admin.addFilter- Easily add a filtered value.addMedia- Add files to the media library.addPage- Add a page with title and content.addPost- Add a post with title, content, type, status, and date.addProduct- Add a WooCommerce product (will install WooCommerce if not present)addTemplate- Add a template (home, single, page, etc.) for a block theme.addTemplatePart- Add a template part (header, footer, etc.) for a block theme.blockExamples- Creates a post with all block examples from registered blocksblueprintExtractor- Generate a new blueprint after modifying the WordPress.blueprintRecorder- Record steps made and compile a new blueprint.changeAdminColorScheme- Useful to combine with a login step.cp- Source path.createUser- Create a new user.customPostType- Register a custom post type.debug- Configure WordPress debug settings and optionally install Query Monitor plugin.defineSiteUrl- Changes the site URL of the WordPress installation.deleteAllPosts- Delete all posts, pages, attachments, revisions and menu items.disableWelcomeGuides- Disable the welcome guides in the site editor.doAction- Execute a custom action.dontLogin- Prevent automatic login (Playground logs in as admin by default).enableIntl- Enable PHP Intl extension support.enqueueCss- Enqueue custom CSS on frontend and/or admin.enqueueJs- Enqueue custom JavaScript on frontend and/or admin.fakeHttpResponse- Fake a wp_remote_request() response.generateProducts- Generate WooCommerce products and other data using the WC Smooth Generator plugin (automatically installs WooCommerce and the generator plugin)githubImportExportWxr- Provide useful additional info.githubPlugin- Install a plugin from a Github repository.githubPluginRelease- Install a specific plugin release from a Github repository.githubTheme- Install a theme from a Github repository.gitPlugin- Install a plugin from a Git repository (GitHub, GitLab, Bitbucket, Codeberg, etc.).gitTheme- Install a theme from a Git repository (GitHub, GitLab, Bitbucket, Codeberg, etc.).importFriendFeeds- Add subscriptions to the Friends plugin.importThemeStarterContent- The step identifier.importWordPressComExport- Import a WordPress.com export file (WXR in a ZIP)importWordPressFiles- The zip file containing the top-level WordPress files and.installAdminer- Install Adminer with auto login link.installPhEditor- Install phEditor. Password: admininstallPhpLiteAdmin- Provide phpLiteAdmin. Password: adminjetpackOfflineMode- Start Jetpack in Offline mode.mkdir- The path of the directory you want to create.muPlugin- Add code for a plugin.mv- Source path.removeDashboardWidgets- Remove widgets from the wp-admin dashboard.renameDefaultCategory- Change the default "Uncategorized".request- Request details (See.resetData- Deletes WordPress posts and comments and sets the auto increment sequence.rm- The path to remove.rmdir- The path to remove.runSql- The step identifier.runWpCliCommand- Run a wp-cli command.runWpInstallationWizard- Installs WordPress.sampleContent- Inserts sample pages to the site.setLandingPage- Set the landing page.setLanguage- Set the WordPress site language.setSiteName- Set the site name and tagline.setTT4Homepage- Set the homepage for the twentytwentyfour theme.showAdminNotice- Show an admin notice in the dashboard.siteHealthImport- Import site configuration from WordPress Site Health info (Tools β Site Health β Info β Copy site info to clipboard).skipWooCommerceWizard- When running WooCommerce, don't show the wizard.unzip- The zip file to extract.writeFile- The path of the file to write to.writeFiles- The path of the file to write to.
