Opened 5 years ago
Last modified 5 weeks ago
#6531 assigned defect (bug)
Recursively search for files in theme and plugin editors
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Template | Version: | 2.5 |
| Severity: | minor | Keywords: | has-patch needs-testing |
| Cc: | torbens, christophe@…, hm2k, Ken@…, daedalon@… |
Description
Themes (like Subtle: http://gluedideas.com/downloads/subtle/) might contain numerous CSS files. The theme editor, however, does not recognize any other CSS files other than style.css.
The files might be located some levels deeper in sub directories like '/wp-content/themes/glued-ideas-subtle-01/assets/css/print.css'.
Attachments (2)
Change History (21)
- Type changed from defect (bug) to enhancement
It's not common, but it occurs. The patch from #6632 partially sorts this if the files are in a direct subfolder. If you've a file any deeper, it won't do any good. example:
wp-content/themes/sem-reloaded/skins/copywriter-blue/skin.css
- Summary changed from CSS files are not shown in Theme Editor to Recursively search for files in theme and plugin editors
the same may also apply to plugins.
- Milestone changed from 2.9 to Future Release
- Cc christophe@… added
- Keywords has-patch needs-testing added; needs-patch removed
- Owner changed from anonymous to chsxf
- Status changed from new to assigned
Patch is attached.
It includes :
- recursive search for files in both Theme and Plugin editors
- sorting of files by path and name
- inclusion of JavaScript files in the Theme editor
- Cc hm2k added
- Type changed from enhancement to defect (bug)
Is there any logical reason why you would not display all of the theme's CSS files from subdirectories in the theme editor?
Changing to a bug because expected behaviour is that all CSS files in the theme are shown.
The patch i've submitted two months ago brings this fonctionnality for CSS, JS and PHP files.
comment:10
hm2k — 20 months ago
Is there any reason why you would NOT want to apply this patch?
Is there any reason you would NOT want this feature?
This bug has been open for 4 years, is there any reason why this bug cannot be closed?
Thanks!
comment:11
WraithKenny — 16 months ago
- Cc Ken@… added
comment:12
prionkor — 11 months ago
- Type changed from defect (bug) to enhancement
I would like to see this on future release. Perhaps the directory structure with js/jq implement.
Related: #17036
comment:14
SergeyBiryukov — 3 months ago
#23500 was marked as a duplicate.
comment:15
SergeyBiryukov — 3 months ago
Related: #22924
comment:16
SergeyBiryukov — 6 weeks ago
#24050 was marked as a duplicate.
comment:17
Daedalon — 5 weeks ago
- Cc daedalon@… added
- Type changed from enhancement to defect (bug)
Thanks Mike for the patch! Verified, works. Also improves the coding style to match http://make.wordpress.org/core/handbook/coding-standards/php/.
I'd like to see this included in 3.6 after two improvements:
- Use curly braces with all ifs. Avoids hassle and bugs in later edits. A decent percentage of bugs are caused by editing code like this:
} else {
if ( plugin_basename("$dir/$file") != $plugin )
$plugin_files[] = plugin_basename("$dir/$file");
}
- Theme editor could use the same functionality.
Marking ticket as defect (bug) instead of enhancement. More appropriate for the file list not displaying all files of a plugin or theme. Milestone, anyone?
comment:18
Daedalon — 5 weeks ago
- In order to improve performance, instead of calling this function twice inside a loop:
plugin_basename("$dir/$file")
Split it into these parts, the first of which is to be called only once in the beginning of the function:
$plugin_basedir = plugin_basename($dir); ... "$plugin_basedir/$file"
The patch in #24049 also applies this change.
comment:19
Daedalon — 5 weeks ago
Encountered a bug:
- After opening a file from within a subdirectory, the Plugin Files lists only files and directories under that subdirectory.

Could be lumped in with #6632 maybe. No point in having 2 generic editors. Not sure how common buried stylesheets are.