Opened 11 years ago
Closed 10 years ago
#27068 closed defect (bug) (worksforme)
JS var thickboxL10n is added twice
Reported by: | finalwebsites | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8.1 |
Component: | Script Loader | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
Hi,
If you enable thickbox using
wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox');
Wordpress inserts the text/labels in your blog's language into the footer like:
var thickboxL10n = {"next":"Volgende >","prev":"< Vorige","image":"Afbeelding","of":"van","close":"Sluiten","noiframes":"Deze eigenschap vereist inline frames. Je hebt inline frames uitgeschakeld of je browser ondersteunt dit niet.","loadingAnimation":"http:\/\/www.domein.nl\/wp-includes\/js\/thickbox\/loadingAnimation.gif"};
Since version 3.8 this code is added twice into the footer.
Anything else related to thickbox is okay
Change History (3)
#2
@
11 years ago
- Keywords reporter-feedback added; needs-testing removed
Could not reproduce on a clean install, thickboxL10n
is only added once for me.
Could you check if the issue still exists with all plugins disabled and a default theme (Twenty Fourteen or Twenty Thirteen) activated? Make sure you use the correct action for wp_enqueue_script()
, i.e. wp_enqueue_scripts
or admin_enqueue_scripts
.
Swapping $scripts->localize()
with $scripts->add()
here seems weird and would be inconsistent with localizing other scripts.
Note: See
TracTickets for help on using
tickets.
I found the problem located in wp-includes/script-loader.php.
The localization function need be called before the thickbox script is added.
If you switch position the problem is solved: