Opened 18 years ago
Closed 16 years ago
#4131 closed task (blessed) (fixed)
Edit Theme should allow editing files in subfolders
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.0.10 |
Component: | Themes | Keywords: | edit themes has-patch |
Focuses: | Cc: |
Description
I have noticed an error that occurs while editing themes from Wordpress' control panel. If there are folders inside the theme folder (i.e. theme/widgets/) the 'widgets' folder is not listed..
Attachments (1)
Change History (19)
#1
@
18 years ago
- Milestone changed from 2.0.11 to 2.4
- Summary changed from Editing subfolders of a Wordpress Theme to Edit Theme should allow editing files in subfolders
#4
follow-up:
↓ 5
@
17 years ago
Looking at the code the problem would be with
wp-admin/theme-editor.php on line 21
$allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']);
This appears to be where the file list is called, maybe it might be possible to follow the sub folders of $themes[$theme]
#5
in reply to:
↑ 4
@
17 years ago
- Milestone changed from 2.3 to 2.4
Replying to thee17:
Looking at the code the problem would be with
wp-admin/theme-editor.php on line 21
No, the problem is inside get_themes(), which is called on line 9.
#7
@
17 years ago
- Keywords has-patch added; hunt-inactive removed
Patch allows get_themes to see Template files in sub-dirs, Has the main impact of allowing the theme editor to view them.
As a side effect of allowing get_themes() to return template files in subdirectories(only a single level -- And stylesheets are not looked for), Templates could exist in the folder, Under the current situation template files can only exist within the main theme directory.
As such, I added a function theme_basename()
it basically returns the path of a file relitive to its theme directory, ie. theme_basename('wp-content/themes/my-theme/extra-templates/template1.php') will return 'extra-templates/template1.php'. That allows for the templates to continue working correctly.
Templates can now exist in those subdirectories.
#12
@
16 years ago
- Milestone changed from 2.9 to 2.8
Seeing recent changes in editing capabilites in 2.8 coming, shouldn't this also get fixed in 2.8 Any progress? I would love to see this too...its tiring to edit some files via FTP and remaining via WP-Admin..it would be good if I could edit right from dashboard now that syntax highlighting is also there.
ENV: WP trunk (2.2) r5237
Reproduced bug using default theme. At wp-admin/theme-editor.php I do not see default/images/header-img.php in the list.