[wp-trac] [WordPress Trac] #23661: get_theme_root_uri doesn't get correct theme root for themes in folders registered by register_theme_directory

WordPress Trac noreply at wordpress.org
Fri Mar 1 22:59:40 UTC 2013


#23661: get_theme_root_uri doesn't get correct theme root for themes in folders
registered by register_theme_directory
-----------------------------+--------------------------
 Reporter:  davidosomething  |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Themes
  Version:  3.5.1            |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 get_theme_root_uri doesn't get correct theme root for themes in folders
 registered by register_theme_directory

 Doing this in wp-config.php:
 {{{
 define('DKO_ABSPATH', __DIR__ . '/');
 // just sets DKO_ABSPATH to the path of the wp-config.php file, which
 happens to be my web root
 }}}

 Doing this in an mu-plugin:
 {{{
 register_theme_directory( DKO_ABSPATH . 'themes/' );
 // add the webroot/themes folder as a  theme directory, trailing slash
 required (ideally trailingslashit in the register_theme_directory
 function)
 }}}

 Yields this for get_stylesheet_uri():
 {{{
 http://www.davidosomething.dev/wp/Users/dotrakoun/Sites/openshift/main/php/themes/2013-davidosomething/style.css?ver=3.5.1
 }}}

 i.e. the full path is returned instead of the uri.

 Think the case matching in theme.php lines 477-490 (get_theme_root_uri)
 doesn't cover paths registered using register_theme_directory but outside
 of ABSPATH, site_url, and content_url

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23661>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list