editable_extensions
Filter HookDescription
Filters the list of file types allowed for editing in the plugin file editor.Hook Information
File Location |
wp-admin/includes/file.php
View on GitHub
|
Hook Type | Filter |
Line Number | 238 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$default_types
|
An array of editable plugin file extensions. |
string
|
$plugin
|
Path to the plugin file relative to the plugins directory. |
Usage Examples
Basic Usage
<?php
// Hook into editable_extensions
add_filter('editable_extensions', 'my_custom_filter', 10, 2);
function my_custom_filter($default_types, $plugin) {
// Your custom filtering logic here
return $default_types;
}
Source Code Context
wp-admin/includes/file.php:238
- How this hook is used in WordPress core
<?php
233 * @since 4.9.0 Added the `$plugin` parameter.
234 *
235 * @param string[] $default_types An array of editable plugin file extensions.
236 * @param string $plugin Path to the plugin file relative to the plugins directory.
237 */
238 $file_types = (array) apply_filters( 'editable_extensions', $default_types, $plugin );
239
240 return $file_types;
241 }
242
243 /**
PHP Documentation
<?php
/**
* Filters the list of file types allowed for editing in the plugin file editor.
*
* @since 2.8.0
* @since 4.9.0 Added the `$plugin` parameter.
*
* @param string[] $default_types An array of editable plugin file extensions.
* @param string $plugin Path to the plugin file relative to the plugins directory.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/file.php
Related Hooks
Related hooks will be displayed here in future updates.