WordPress at a glance
function is not described

WP_REST_Plugins_Controller::get_plugin_status() protected WP 5.5.0

Get's the activation status for a plugin.

{} It's a method of the class: WP_REST_Plugins_Controller{}

No Hooks.

Return

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.

Code of WP_REST_Plugins_Controller::get_plugin_status() WP 5.5.2

<?php
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';
}