Opened 8 months ago
Last modified 8 months ago
#21969 new defect (bug)
Wrong URL in wp_enqueue_script()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Themes | Version: | 3.4 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | pavelevap@… |
Description
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.
Attachments (1)
Change History (3)
SergeyBiryukov — 8 months ago
comment:1
SergeyBiryukov — 8 months ago
- Keywords has-patch added
comment:2
SergeyBiryukov — 8 months ago
- Version changed from trunk to 3.4
Note: See
TracTickets for help on using
tickets.

Related: ticket:21749:2
get_*_directory_uri() should probably return encoded results, like their WP_Theme counterparts.