@wp-playground/blueprints
Index
Classes
Functions
- activatePlugin
- activateTheme
- compileBlueprint
- cp
- defineSiteUrl
- defineWpConfigConsts
- enableMultisite
- exportWXR
- getBlueprintDeclaration
- importThemeStarterContent
- importWordPressFiles
- importWxr
- installPlugin
- installTheme
- isBlueprintBundle
- login
- mkdir
- mv
- request
- resetData
- resolveRemoteBlueprint
- rm
- rmdir
- runBlueprintSteps
- runPHP
- runPHPWithOptions
- runSql
- runWpInstallationWizard
- setPluginProxyURL
- setSiteLanguage
- setSiteOptions
- unzip
- updateUserMeta
- wpCLI
- writeFile
- writeFiles
- zipWpContent
Interfaces
- ActivatePluginStep
- ActivateThemeStep
- CompileBlueprintOptions
- CompiledBlueprint
- CpStep
- DefineSiteUrlStep
- DefineWpConfigConstsStep
- EnableMultisiteStep
- ImportThemeStarterContentStep
- ImportWordPressFilesStep
- ImportWxrStep
- InstallPluginOptions
- InstallPluginStep
- InstallThemeOptions
- InstallThemeStep
- MkdirStep
- MvStep
- ResetDataStep
- RmStep
- RmdirStep
- RunPHPStep
- RunPHPWithOptionsStep
- RunSqlStep
- SetSiteLanguageStep
- UnzipStep
- UpdateUserMetaStep
- WPCLIStep
- WordPressInstallationOptions
- WriteFileStep
- WriteFilesStep
Type Aliases
Variables
Type Aliases
Blueprint
BlueprintBundle
BlueprintDeclaration
The Blueprint declaration, typically stored in a blueprint.json file.
Type declaration
optionalconstants?: PHPConstants
PHP Constants to define on every request
optionaldescription?: string
Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what.
optionalextraLibraries?: ExtraLibrary[]
Extra libraries to preload into the Playground instance.
optionalfeatures?: { intl?: boolean; networking?: boolean }
optionalintl?: boolean
optionalnetworking?: boolean
Should boot with support for network request via wp_safe_remote_get?
optionallandingPage?: string
The URL to navigate to after the blueprint has been run.
optionallogin?: boolean | { password: string; username: string }
User to log in as. If true, logs the user in as admin/password.
optionalmeta?: { author: string; categories?: string[]; description?: string; title: string }
Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints
author: string
A GitHub username of the author of this Blueprint.
optionalcategories?: string[]
Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org.
optionaldescription?: string
A brief explanation of what your Blueprint offers.
title: string
A clear and concise name for your Blueprint.
optionalphpExtensionBundles?: any
optionalplugins?: (string | FileReference)[]
WordPress plugins to install and activate
optionalpreferredVersions?: { php: SupportedPHPVersion | latest; wp: string | latest }
The preferred PHP and WordPress versions to use.
php: SupportedPHPVersion | latest
The preferred PHP version to use. If not specified, the latest supported version will be used
wp: string | latest
The preferred WordPress version to use. If not specified, the latest supported version will be used
optionalsiteOptions?: Record<string, string> & { blogname?: string }
WordPress site options to define
optionalsteps?: (StepDefinition | string | undefined | false | null)[]
The steps to run after every other operation in this Blueprint was executed.
CompiledStep
Type declaration
Parameters
php: UniversalPHP
Returns Promise<void> | void
CorePluginReference
Type declaration
resource: wordpress.org/plugins
Identifies the file resource as a WordPress Core plugin
slug: string
The slug of the WordPress Core plugin
CoreThemeReference
Type declaration
resource: wordpress.org/themes
Identifies the file resource as a WordPress Core theme
slug: string
The slug of the WordPress Core theme
FileReference
GenericStep
If you add a step here, make sure to also add it to the exports below.
Type parameters
- FileResource
- DirectoryResource
LiteralReference
Type declaration
contents: string | Uint8Array
The contents of the file
name: string
The name of the file
resource: literal
Identifies the file resource as a literal file
LoginStep
Logs in to Playground.
Under the hood, this function sets the PLAYGROUND_AUTO_LOGIN_AS_USER
constant.
The 0-auto-login.php
mu-plugin uses that constant to log in the user on the first load.
This step depends on the @wp-playground/wordpress
package because
the plugin is located in and loaded automatically by the @wp-playground/wordpress
package.
Type declaration
optionalpassword?: string
step: login
optionalusername?: string
The user to log in as. Defaults to 'admin'.
OnStepCompleted
Type declaration
Parameters
output: any
step: StepDefinition
Returns any
PHPConstants
SetSiteOptionsStep
Sets site options. This is equivalent to calling update_option
for each
option in the options
object.
Type declaration
options: Record<string, unknown>
The options to set on the site.
step: setSiteOptions
The name of the step. Must be "setSiteOptions".
Step
StepDefinition
StepHandler
Type parameters
- S: GenericStep<File, Directory>
- Return = any
Type declaration
Parameters
php: UniversalPHP
args: Omit<S, step>
optionalprogressArgs: StepProgress
Returns Return
StepProgress
UrlReference
Type declaration
optionalcaption?: string
Optional caption for displaying a progress message
resource: url
Identifies the file resource as a URL
url: string
The URL of the file
VFSReference
Type declaration
path: string
The path to the file in the VFS
resource: vfs
Identifies the file resource as Virtual File System (VFS)
Variables
constResourceTypes
constwpContentFilesExcludedFromExport
Used by the export step to exclude the Playground-specific files from the zip file. Keep it in sync with the list of files created by WordPressPatcher.
A filesystem structure containing a /blueprint.json file and any resources referenced by that blueprint.