Aller au contenu principal

InstallPluginStep <FileResource, DirectoryResource>

Installs a WordPress plugin in the Playground.

@hasRunnableExample
@needsLogin
@landingPage

/wp-admin/plugins.php

@example
<code>
{
"step": "installPlugin",
"pluginData": {
"resource": "wordpress.org/plugins",
"slug": "gutenberg"
},
"options": {
"activate": true
}
}
</code>
@example
<code>
{
"step": "installPlugin",
"pluginData": {
"resource": "git:directory",
"url": "https://github.com/wordpress/wordpress-playground.git",
"ref": "HEAD",
"path": "wp-content/plugins/hello-dolly"
},
"options": {
"activate": true
}
}
</code>

Hierarchy

  • Pick<InstallAssetOptions, ifAlreadyInstalled>
    • InstallPluginStep

Index

Properties

optionalifAlreadyInstalled

ifAlreadyInstalled?: overwrite | skip | error

What to do if the asset already exists.

optionaloptions

Optional installation options.

pluginData

pluginData: FileResource | DirectoryResource

The plugin files to install. It can be either a plugin zip file, or a directory containing all the plugin files at its root.

optionalpluginZipFile

pluginZipFile?: FileResource

@deprecated. Use pluginData instead.

step

step: installPlugin

The step identifier.