Uses
Uses | Description |
---|---|
wp-includes/formatting.php: sanitize_text_field() | Sanitizes a string from user input or from the database. |
wp-includes/plugin.php: plugin_basename() | Gets the basename of a plugin. |
Sanitizes the “plugin” parameter to be a proper plugin file with “.php” appended.
(string) (Required) The plugin file parameter.
(string)
File: wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php
public function sanitize_plugin_param( $file ) { return plugin_basename( sanitize_text_field( $file . '.php' ) ); }
Version | Description |
---|---|
5.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_plugins_controller/sanitize_plugin_param