Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In web development, I get used to place css/js files under separate folders (css folder, js folder ..etc).

What I am experiencing in WordPress is that I cannot access these folders in WordPress Admin Editor Page, the editor only displays the files under the main theme folder, not the nested folders.

Is there an option to enable showing nested folders? is there a plugin to accomplish that? If not, then what is the best practice to follow for placing files and folders under WordPress folder?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The theme editor is located under /wp-admin/theme-editor.php and uses get_current_theme(); to give you the first files to edit. From the returned array of theme data, it uses 'Template Dir' to locate the directory and 'Template Files' to give you a list of files to edit (loops through the files with a foreach loop). For stylesheets it uses 'Stylesheet Dir' and 'Stylesheet Files' to loop through.

Point is that:

1. there are no filters or hooks, so you'd need to modify core directly (which is not recommended, as your changes would be overwritten on update) and

2. you'd need to write a function that reads the whole folder, finds all subfolders and then another one to find all containing files and last loop through them too.

share|improve this answer
    
Okay, so there is no plugin already built to address this functionality? –  Ahmad Alkhawaja Oct 9 '11 at 17:18
    
No and no: No plugin and no action filter/hook to use a plugin. –  kaiser Oct 9 '11 at 17:29
1  
Thank you very much :) –  Ahmad Alkhawaja Oct 9 '11 at 18:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.