Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#46988 new defect (bug)

Theme dir hardcode

Reported by: studioreforma's profile studioreforma Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.1.1
Component: Themes Keywords:
Focuses: Cc:


This is about the get_raw_theme_root() function in wp-includes/theme.php

When the $wp_theme_directories global has only one theme directory in it, the functions returns a hardcoded path of /themes which will be treated later as relative to the content folder. The correct behaviour would be to return the actual string from the $wp_theme_directories global.

This is a problem when a user is using a custom theme directory and has deleted the themes directory in the content folder. Then his global $wp_theme_directories will contain only one path - the one to his themes directory, but WP will be looking in the content/themes directory instead in the Themes admin page.

I had this issue on multisite, but should be the same on single sites I think.

Change History (2)

#1 follow-up: @mehrshaddarzi
5 years ago


i created a new Patch for this Problem.


#2 in reply to: ↑ 1 @studioreforma
5 years ago


WP_THEMES_DIR implies that only folder can be used, so it's not going to work. Your second patch is probably a better solution, but it's hard for me to comment on the other file changes as I haven't looked into them.

Note: See TracTickets for help on using tickets.