WP_REST_Plugins_Controller::sanitize_plugin_param()
Sanitizes the "plugin" parameter to be a proper plugin file with ".php" appended.
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. |
WP_REST_Plugins_Controller::sanitize_plugin_param() WP REST Plugins Controller::sanitize plugin param code WP 6.6.1
public function sanitize_plugin_param( $file ) { return plugin_basename( sanitize_text_field( $file . '.php' ) ); }