WP_REST_Plugins_Controller::get_plugin_status
Get's the activation status for a plugin.
Method of the class: WP_REST_Plugins_Controller{}
No Hooks.
Returns
String. Either 'network-active', 'active' or 'inactive'.
Usage
// protected - for code of main (parent) or child class $result = $this->get_plugin_status( $plugin );
- $plugin(string) (required)
- The plugin file to check.
Changelog
| Since 5.5.0 | Introduced. |
WP_REST_Plugins_Controller::get_plugin_status() WP REST Plugins Controller::get plugin status code WP 7.0
protected function get_plugin_status( $plugin ) {
if ( is_plugin_active_for_network( $plugin ) ) {
return 'network-active';
}
if ( is_plugin_active( $plugin ) ) {
return 'active';
}
return 'inactive';
}