wp_theme_editor_filetypes
Filters the list of file types allowed for editing in the theme file editor.
Usage
add_filter( 'wp_theme_editor_filetypes', 'wp_kama_theme_editor_filetypes_filter', 10, 2 ); /** * Function for `wp_theme_editor_filetypes` filter-hook. * * @param string[] $default_types An array of editable theme file extensions. * @param WP_Theme $theme The active theme object. * * @return string[] */ function wp_kama_theme_editor_filetypes_filter( $default_types, $theme ){ // filter... return $default_types; }
- $default_types(string[])
- An array of editable theme file extensions.
- $theme(WP_Theme)
- The active theme object.
Changelog
Since 4.4.0 | Introduced. |
Where the hook is called
wp_theme_editor_filetypes
wp-admin/includes/file.php 296
$file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );