WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#13726 closed defect (bug) (duplicate)

thickbox.js relative image paths break on children pages

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

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 3 years ago.
Thickbox working on Parent Page
tb_child.jpg (77.3 KB) - added by layotte 3 years ago.
Thickbox NOT working on Child Page

Download all attachments as: .zip

Change History (3)

layotte3 years ago

Thickbox working on Parent Page

layotte3 years ago

Thickbox NOT working on Child Page

comment:1 dd323 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.