Opened 12 years ago
Closed 10 years ago
#25734 closed defect (bug) (worksforme)
theme-editor non functional whith a child theme
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.7 |
| Component: | Themes | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
Hi,
I just created a simple child theme, named ys, before upgrading my Twentythirteen theme.
Since I have started using this child theme, I cannot use the built-in theme editor : loading wp-admin/theme-editor.php brings a message "Désolé, on ne peut pas modifier les fichiers avec « .. » dans le nom.", which in admin-fr_FR.po is
#: wp-admin/includes/file.php:180
msgid ""
"Sorry, can’t edit files with “..” in the name. If you are "
"trying to edit a file in your WordPress home directory, you can just type "
"the name of the file in."
This seems to be fired from line 76 of theme-editor.php. Further investigation shows that the default file that the editor tries to display is wp-content/themes/ys/./style.css.
The presence of "./" in the path is disliked by validate_file() in wp-includes/functions.php
It seems to come from the fact that WP_Theme::get_stylesheet_directory() returns "wp-content/themes/ys/." (with the dot at the end) when called on my child theme.
Hello YS1,
Sorry you never got a response.
Unfortunately I can't reproduce your bug. Trying to open a child theme in the editor works for me. Even if I'm playing around with the name and add
..or./to the theme name.Though there seem to be other people having a related problem #25924