@wp-playground/client
Index
Classes
Functions
- activatePlugin
- activateTheme
- compileBlueprint
- cp
- defineSiteUrl
- defineWpConfigConsts
- enableMultisite
- exportWXR
- importThemeStarterContent
- importWordPressFiles
- importWxr
- installPlugin
- installTheme
- login
- mkdir
- mv
- phpVar
- phpVars
- request
- resetData
- rm
- rmdir
- runBlueprintSteps
- runPHP
- runPHPWithOptions
- runSql
- runWpInstallationWizard
- setPhpIniEntries
- setPluginProxyURL
- setSiteLanguage
- setSiteOptions
- startPlaygroundWeb
- unzip
- updateUserMeta
- wpCLI
- writeFile
- writeFiles
- zipWpContent
Interfaces
- ActivatePluginStep
- ActivateThemeStep
- Blueprint
- CompileBlueprintOptions
- CompiledBlueprint
- CpStep
- DefineSiteUrlStep
- DefineWpConfigConstsStep
- EnableMultisiteStep
- ErrnoError
- ImportThemeStarterContentStep
- ImportWordPressFilesStep
- ImportWxrStep
- InstallPluginOptions
- InstallPluginStep
- InstallThemeOptions
- InstallThemeStep
- MkdirStep
- MountDescriptor
- MvStep
- PHPOutput
- PHPRequest
- PHPResponseData
- PHPRunOptions
- PlaygroundClient
- ResetDataStep
- RmDirOptions
- RmStep
- RmdirStep
- RunPHPStep
- RunPHPWithOptionsStep
- RunSqlStep
- SetSiteLanguageStep
- StartPlaygroundOptions
- UnzipStep
- UpdateUserMetaStep
- WPCLIStep
- WordPressInstallationOptions
- WriteFileStep
- WriteFilesStep
Type Aliases
- CompiledStep
- CorePluginReference
- CoreThemeReference
- FileReference
- GenericStep
- HTTPMethod
- LiteralReference
- LoginStep
- OnStepCompleted
- PHPConstants
- 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
- FileResource
- DirectoryResource
HTTPMethod
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
PHPRequestHandlerConfiguration
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, Directory>
- 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