WP_REST_Plugins_Controller::is_plugin_installed()protectedWP 5.5.0

Checks if the plugin is installed.

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

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_plugin_installed( $plugin );
$plugin(string) (required)
The plugin file.

Changelog

Since 5.5.0 Introduced.

Code of WP_REST_Plugins_Controller::is_plugin_installed() WP 5.9.3

protected function is_plugin_installed( $plugin ) {
	return file_exists( WP_PLUGIN_DIR . '/' . $plugin );
}