WordPress at a glance
function is not described

WP_REST_Plugins_Controller::sanitize_plugin_param() public WP 5.5.0

Sanitizes the "plugin" parameter to be a proper plugin file with ".php" appended.

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

No Hooks.

Return

String.

Usage

$WP_REST_Plugins_Controller = new WP_REST_Plugins_Controller();
$WP_REST_Plugins_Controller->sanitize_plugin_param( $file );
$file(string) (required)
The plugin file parameter.

Changelog

Since 5.5.0 Introduced.

Code of WP_REST_Plugins_Controller::sanitize_plugin_param() WP 5.5.1

<?php
public function sanitize_plugin_param( $file ) {
	return plugin_basename( sanitize_text_field( $file . '.php' ) );
}