Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#13726 closed defect (bug) (duplicate)

thickbox.js relative image paths break on children pages

Reported by: layotte's profile layotte Owned by: azaozz's profile azaozz
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: JavaScript Keywords: thickbox
Focuses: Cc:

Description

I originally found this little bug when trying to implement thickbox in WPMU on a page in a subsite, it also affects WP as well for child pages.

Currrently in thickbox.js the images are relatively assigned this way (line 9 & 12):
tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif";
tb_closeImage = "../wp-includes/js/thickbox/tb-close.png";

I'm enqueueing WordPress' thickbox in my theme's function.php:

wp_enqueue_script( 'thickbox', , 'jquery', , true );
wp_enqueue_style( 'thickbox' );

Here is an example of the issue, the images work fine on:
http://trunk.lewayotte.com/thickbox/

But not on:
http://trunk.lewayotte.com/thickbox/tb_child/

For my needs, I am able to remove the ".." for the relative path, however that will break it for users whose WP installation is not in the root directory of their site.

Attachments (2)

thickbox.jpg (77.2 KB) - added by layotte 15 years ago.
Thickbox working on Parent Page
tb_child.jpg (77.3 KB) - added by layotte 15 years ago.
Thickbox NOT working on Child Page

Download all attachments as: .zip

Change History (3)

@layotte
15 years ago

Thickbox working on Parent Page

@layotte
15 years ago

Thickbox NOT working on Child Page

#1 @dd32
15 years ago

  • Milestone Unassigned deleted
  • Resolution set to duplicate
  • Status changed from new to closed

See #6453 for the workaround you must use.

Note: See TracTickets for help on using tickets.