@wp-playground/client
Index
Classes
Functions
- activatePlugin
- activateTheme
- compileBlueprint
- connectPlayground
- cp
- defineSiteUrl
- defineWpConfigConsts
- enableMultisite
- exportWXR
- importWordPressFiles
- importWxr
- installPlugin
- installTheme
- login
- mkdir
- mv
- phpVar
- phpVars
- request
- rm
- rmdir
- runBlueprintSteps
- runPHP
- runPHPWithOptions
- runSql
- runWpInstallationWizard
- setPluginProxyURL
- setSiteOptions
- startPlaygroundWeb
- unzip
- updateUserMeta
- wpCLI
- writeFile
- zipWpContent
Interfaces
- ActivatePluginStep
- ActivateThemeStep
- Blueprint
- CompileBlueprintOptions
- CompiledBlueprint
- CpStep
- DefineSiteUrlStep
- DefineWpConfigConstsStep
- EnableMultisiteStep
- ErrnoError
- ImportWordPressFilesStep
- ImportWxrStep
- InstallPluginOptions
- InstallPluginStep
- InstallThemeOptions
- InstallThemeStep
- MkdirStep
- MvStep
- PHPOutput
- PHPRequest
- PHPResponseData
- PHPRunOptions
- PlaygroundClient
- ResourceOptions
- RmDirOptions
- RmStep
- RmdirStep
- RunPHPStep
- RunPHPWithOptionsStep
- RunSqlStep
- StartPlaygroundOptions
- UnzipStep
- UpdateUserMetaStep
- WPCLIStep
- WordPressInstallationOptions
- WriteFileStep
Type Aliases
- CompiledStep
- CorePluginReference
- CoreThemeReference
- FileReference
- GenericStep
- HTTPMethod
- IsomorphicRemotePHP
- LiteralReference
- LoginStep
- OnStepCompleted
- PHPRequestHandlerConfiguration
- PHPRequestHeaders
- RuntimeType
- SetSiteOptionsStep
- Step
- StepDefinition
- StepHandler
- StepProgress
- SupportedPHPVersion
- UniversalPHP
- UrlReference
- VFSReference
Variables
Type Aliases
CompiledStep
Type declaration
Parameters
php: UniversalPHP
Returns Promise<void> | void
CorePluginReference
Type declaration
resource: wordpress.org/plugins
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
- Resource
HTTPMethod
IsomorphicRemotePHP
The omited methods must either be called synchronously before the PHP internal state is initialized, or with a complex argument that can’t be serialized over a remote connection. Therefeore, they don’t make sense in a remote PHP instance.
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 the Playground. Under the hood, this function submits the wp-login.php form just like a user would.
Type declaration
optionalpassword?: string
The password to log in with. Defaults to ‘password’.
step: login
optionalusername?: string
The user to log in as. Defaults to ‘admin’.
OnStepCompleted
Type declaration
Parameters
output: any
step: StepDefinition
Returns any
PHPRequestHandlerConfiguration
Type parameters
- PHP: BasePHP
PHPRequestHeaders
RuntimeType
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>
- Return = any
Type declaration
Parameters
php: UniversalPHP
args: Omit<S, step>
optionalprogressArgs: StepProgress
Returns Return
StepProgress
Progress reporting details.
Type declaration
optionalinitialCaption?: string
tracker: ProgressTracker
SupportedPHPVersion
UniversalPHP
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
constLatestSupportedPHPVersion
constResourceTypes
constSupportedPHPVersions
constSupportedPHPVersionsList
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.
Identifies the file resource as a WordPress Core plugin