editable_extensions
Filters the list of file types allowed for editing in the plugin file editor.
Использование
add_filter( 'editable_extensions', 'wp_kama_editable_extensions_filter', 10, 2 ); /** * Function for `editable_extensions` filter-hook. * * @param string[] $default_types An array of editable plugin file extensions. * @param string $plugin Path to the plugin file relative to the plugins directory. * * @return string[] */ function wp_kama_editable_extensions_filter( $default_types, $plugin ){ // filter... return $default_types; }
- $default_types(string[])
- An array of editable plugin file extensions.
- $plugin(строка)
- Path to the plugin file relative to the plugins directory.
Список изменений
С версии 2.8.0 | Введена. |
С версии 4.9.0 | Added the $plugin parameter. |
Где вызывается хук
editable_extensions
wp-admin/includes/file.php 238
$file_types = (array) apply_filters( 'editable_extensions', $default_types, $plugin );