[wp-trac] [WordPress Trac] #21969: Wrong URL in wp_enqueue_script()

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 22 19:21:22 UTC 2012


#21969: Wrong URL in wp_enqueue_script()
-----------------------------+--------------------------
 Reporter:  pavelevap        |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Themes
  Version:  trunk            |   Severity:  normal
 Keywords:                   |
-----------------------------+--------------------------
 This problem is probably related to fixed ticket #21749

 Example theme directory

 {{{
 wp-content/themes/Some Theme/Theme
 }}}

 I noticed it with one premium theme. Users usually upload downloaded files
 through FTP with one more parent directory.

 Function get_template_directory_uri() returns right URL:


 {{{
 wp-content/themes/Some Theme/Theme
 }}}


 But using it with wp_enqueue_script():


 {{{
 wp_enqueue_script( 'maxheight',  get_template_directory_uri() .
 '/js/maxheight.js' );
 }}}


 it returns wrong URL:


 {{{
 wp-content/themes/SomeTheme/Theme/js/maxheight.js
 }}}

 And script is not loaded in the end (Not Found error).

 Reproduced on current trunk and 3.4.x.

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


More information about the wp-trac mailing list