WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#23500 closed defect (bug) (duplicate)

Add action hook to Theme Editor

Reported by: biznis86 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Themes Keywords:
Focuses: Cc:

Description

Just before line 75 of file wp-admin/theme-editor.php, add action hook for developers to plug in. Perhaps sth like:
do_action('theme_editor_files');

This way, developers can hook into file editor and add their own files like stylesheets in subfolders and php files in level 2 subfolders.

Change History (3)

#1 @biznis86
5 years ago

Or just allow editing CSS files in subfolders by editing line 63 to
$style_files = $theme->get_files( 'css', 1 );

This way, level of security will stay the same and developers will gain more space to define theme file structure.

What's the point of having stylesheets in root theme folder anyway?

#2 follow-up: @SergeyBiryukov
5 years ago

  • Component changed from General to Themes
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

An action wouldn't be helpful there, a filter on $allowed_files would be.

Duplicate of #6531, #14175, and #17333.

#3 in reply to: ↑ 2 @SergeyBiryukov
5 years ago

Replying to SergeyBiryukov:

An action wouldn't be helpful there, a filter on $allowed_files would be.

Related: #22924

Note: See TracTickets for help on using tickets.