Opened 8 months ago

Last modified 8 months ago

#21969 new defect (bug)

Wrong URL in wp_enqueue_script()

Reported by: pavelevap 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)

21969.patch (815 bytes) - added by SergeyBiryukov 8 months ago.

Download all attachments as: .zip

Change History (3)

  • Keywords has-patch added

Related: ticket:21749:2

get_*_directory_uri() should probably return encoded results, like their WP_Theme counterparts.

  • Version changed from trunk to 3.4
Note: See TracTickets for help on using tickets.