ImportActivatePlugin
in package
implements
StepProcessor
Uses
UsePluginHelpers
Class ImportActivatePlugin
Interfaces, Classes and Traits
- StepProcessor
- Interface StepProcessor
Table of Contents
- activate_plugin_by_slug() : false|null|WP_Error
- Activate a plugin by its slug.
- check_step_capabilities() : bool
- Check if the current user has the required capabilities for this step.
- deactivate_plugin_by_slug() : bool
- Deactivate a plugin by its slug.
- delete_plugin_by_slug() : bool|WP_Error
- Deactivate and delete a plugin by its slug.
- get_step_class() : string
- Get the step class.
- is_plugin_dir() : bool
- Check if a plugin with the specified slug is installed.
- process() : StepProcessorResult
- Process the schema.
Methods
activate_plugin_by_slug()
Activate a plugin by its slug.
public
activate_plugin_by_slug(string $slug) : false|null|WP_Error
Searches for the plugin with the specified slug in the installed plugins and activates it.
Parameters
- $slug : string
-
The slug of the plugin to activate.
Return values
false|null|WP_Error — Null on success, WP_Error on invalid file, false if not found.check_step_capabilities()
Check if the current user has the required capabilities for this step.
public
check_step_capabilities(object $schema) : bool
Parameters
- $schema : object
-
The schema to process.
Return values
bool — True if the user has the required capabilities. False otherwise.deactivate_plugin_by_slug()
Deactivate a plugin by its slug.
public
deactivate_plugin_by_slug(string $slug) : bool
Searches for the plugin with the specified slug in the installed plugins and deactivates it.
Parameters
- $slug : string
-
The slug of the plugin to deactivate.
Return values
bool — True if the plugin was deactivated, false otherwise.delete_plugin_by_slug()
Deactivate and delete a plugin by its slug.
public
delete_plugin_by_slug(string $slug) : bool|WP_Error
Searches for the plugin with the specified slug in the installed plugins, deactivates it if active, and then deletes it.
Parameters
- $slug : string
-
The slug of the plugin to delete.
Return values
bool|WP_Error — True if the plugin was deleted, false otherwise.get_step_class()
Get the step class.
public
get_step_class() : string
Return values
string —is_plugin_dir()
Check if a plugin with the specified slug is installed.
public
is_plugin_dir(string $slug) : bool
Parameters
- $slug : string
-
The slug of the plugin to check.
Return values
bool —process()
Process the schema.
public
process(object $schema) : StepProcessorResult
Parameters
- $schema : object
-
The schema to process.