WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 4 months ago

#22924 new enhancement

Add filter to theme editor accepted files

Reported by: pross Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version: 3.5
Severity: normal Keywords: has-patch
Cc: mdhansen@…

Description

Proposing adding a filter to theme-editor.php so theme authors can add to the list of files that are editable. ie html/less/js files.

Hers an example of what could be possible:

add_filter( 'wp_theme_editor_filetypes', 'add_my_filetype', 10, 2 );
function add_my_filetype( $allowed_types, $theme ) {
	
	$extra = $theme->get_files( 'less', 1 );
	return $allowed_types += $extra;
}

Attachments (1)

theme-editor.patch (611 bytes) - added by pross 6 months ago.

Download all attachments as: .zip

Change History (4)

pross6 months ago

comment:1 SergeyBiryukov6 months ago

  • Version changed from trunk to 3.5

comment:2 MikeHansenMe4 months ago

  • Cc mdhansen@… added
  • Type changed from defect (bug) to enhancement

Created a test.less file in my theme, added the patch and example. It worked great, I think this would be a good addition.

Note: See TracTickets for help on using tickets.