PluginsProvider
in package
implements
PluginsProviderInterface
Plugins Provider.
Uses the live PluginsHelper.
Interfaces, Classes and Traits
- PluginsProviderInterface
- Plugins Provider Interface
Table of Contents
- $deactivated_plugin_slug : string
- The deactivated plugin slug.
- get_active_plugin_slugs() : array<string|int, mixed>
- Get an array of active plugin slugs.
- get_plugin_data() : array<string|int, mixed>|false
- Get plugin data.
- get_plugin_path_from_slug() : string|false
- Get the path to the plugin file relative to the plugins directory from the plugin slug.
- set_deactivated_plugin() : mixed
- Set the deactivated plugin. This is needed because the deactivated_plugin hook happens before the option is updated which means that getting the active plugins includes the deactivated plugin.
Properties
$deactivated_plugin_slug
The deactivated plugin slug.
private
static string
$deactivated_plugin_slug
= ''
Methods
get_active_plugin_slugs()
Get an array of active plugin slugs.
public
get_active_plugin_slugs() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_plugin_data()
Get plugin data.
public
get_plugin_data(string $plugin) : array<string|int, mixed>|false
Parameters
- $plugin : string
-
Path to the plugin file relative to the plugins directory or the plugin directory name.
Return values
array<string|int, mixed>|false —get_plugin_path_from_slug()
Get the path to the plugin file relative to the plugins directory from the plugin slug.
public
get_plugin_path_from_slug(string $slug) : string|false
E.g. 'woocommerce' returns 'woocommerce/woocommerce.php'
Parameters
- $slug : string
-
Plugin slug to get path for.
Return values
string|false —set_deactivated_plugin()
Set the deactivated plugin. This is needed because the deactivated_plugin hook happens before the option is updated which means that getting the active plugins includes the deactivated plugin.
public
static set_deactivated_plugin(string $plugin_path) : mixed
Parameters
- $plugin_path : string
-
The path to the plugin being deactivated.