wp_get_theme_file_editable_extensions( WP_Theme $theme )

Get list of file extensions that are editable for a given theme.

Parameters Parameters


(WP_Theme) (Required) Theme object.

Top ↑

Return Return

(string[]) Array of editable file extensions.

Top ↑

Source Source

File: wp-admin/includes/file.php

function wp_get_theme_file_editable_extensions( $theme ) {

	$default_types = array(

	 * Filters the list of file types allowed for editing in the Theme editor.
	 * @since 4.4.0
	 * @param string[] $default_types List of allowed file types.
	 * @param WP_Theme $theme         The current Theme object.
	$file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );

	// Ensure that default types are still there.
	return array_unique( array_merge( $file_types, $default_types ) );

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.