#23502 closed defect (bug) (duplicate)
wp_register_script results in the appearance of & HTML entity
Reported by: | computerslayer1 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
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
Change History (4)
Note: See
TracTickets for help on using
tickets.
#10759, #9243