wp_get_plugin_file_editable_extensions( string $plugin )
Get list of file extensions that are editable in plugins.
Parameters
- $plugin
-
(Required) Plugin.
Return
(array) File extensions.
Source
File: wp-admin/includes/file.php
function wp_get_plugin_file_editable_extensions( $plugin ) {
$editable_extensions = array(
'bash',
'conf',
'css',
'diff',
'htm',
'html',
'http',
'inc',
'include',
'js',
'json',
'jsx',
'less',
'md',
'patch',
'php',
'php3',
'php4',
'php5',
'php7',
'phps',
'phtml',
'sass',
'scss',
'sh',
'sql',
'svg',
'text',
'txt',
'xml',
'yaml',
'yml',
);
/**
* Filters file type extensions editable in the plugin editor.
*
* @since WP-2.8.0
* @since WP-4.9.0 Adds $plugin param.
*
* @param string $plugin Plugin file.
* @param array $editable_extensions An array of editable plugin file extensions.
*/
$editable_extensions = (array) apply_filters( 'editable_extensions', $editable_extensions, $plugin );
return $editable_extensions;
}
Changelog
Version | Description |
---|---|
WP-4.9.0 | Introduced. |