WP_REST_Plugins_Controller::sanitize_plugin_param( string $file ): string

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


Parameters

$file string Required
The plugin file parameter.

Top ↑

Return

string


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php. View all references

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


Top ↑

Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes

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