wp_theme_editor_filetypes хук-фильтрWP 4.4.0

Filters the list of file types allowed for editing in the theme file editor.

Использование

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.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

wp_get_theme_file_editable_extensions()
wp_theme_editor_filetypes
wp-admin/includes/file.php 296
$file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );

Где используется хук в WordPress

Использование не найдено.