[wp-trac] [WordPress Trac] #23502: wp_register_script results in the appearance of & HTML entity
WordPress Trac
noreply at wordpress.org
Mon Feb 18 19:13:59 UTC 2013
#23502: wp_register_script results in the appearance of & HTML entity
---------------------------------------+--------------------------
Reporter: computerslayer1 | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: 3.5.1 | Severity: normal
Keywords: needs-patch needs-testing |
---------------------------------------+--------------------------
When using the wp_register_script function in the functions.php file to
override the jquery.js script, the HTML erroneously converts the ampersand
for the cache busting query string into the HTML entity.
{{{
/**
* Override jquery
*/
function mytheme_init(){
if ( !is_admin() ){
wp_deregister_script('jquery');
wp_register_script('jquery',
get_template_directory_uri().'/js/jquery.js?183', array(), '1');
}
}
add_action('init', 'mytheme_init');
}}}
When wp_head() is in the header.php file, it results in this HTML:
{{{
<script type='text/javascript'
src='http://ymca.saratogaregionalymca.org/content/themes/mytheme/js/jquery.js?183&ver=1'></script>
}}}
This appears to be an old bug, as there is a forum thread over a year old
about the issue: http://wordpress.org/support/topic/wp_register_script-
char-is-converted-to?replies=2
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23502>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list