WP_REST_Plugins_Controller::get_plugin_status( string $plugin )

Get’s the activation status for a plugin.


Parameters Parameters

$plugin

(string) (Required) The plugin file to check.


Top ↑

Return Return

(string) Either 'network-active', 'active' or 'inactive'.


Top ↑

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.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';
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.