WP_REST_Plugins_Controller::sanitize_plugin_param( string $file ): string

In this article

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

Parameters

$filestringrequired
The plugin file parameter.

Return

string

Source

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

Changelog

VersionDescription
5.5.0Introduced.

User Contributed Notes

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