Opened 3 years ago
#59539 assigned defect (bug)
wp_register_style and wp_register_script adds ver incorrectly
| Reported by: | forcesail | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Script Loader | Version: | 6.3.1 |
| Severity: | major | Keywords: | |
| Cc: | Focuses: |
Description
Hello,
I'm sorry to report but it seems that function wp_enqueue_style adds ver incorrectly in case of existence some url parameters in src.
For example:
Style example:
<?php add_action( 'wp_enqueue_scripts', function() { wp_enqueue_style( 'my-custom-font', 'https://fonts.googleapis.com/css?family=Roboto+Condensed'); });
adds:
<link rel='stylesheet' id='my-custom-font-css' href='https://fonts.googleapis.com/css?family=Roboto+Condensed&ver=6.3.1' type='text/css' media='all' />
(you see '&' instead of just '&')
Script example (from contact-form-7):
<?php wp_register_script( 'google-recaptcha', add_query_arg( array( 'render' => $service->get_sitekey(), ), $url ), array(), '3.0', true );
adds:
<script type='text/javascript' src='https://www.google.com/recaptcha/api.js?render=6LfrGhQlAAAAAD6sCXSbihhcAwBHfR25-huvzmtQ&ver=3.0' id='google-recaptcha-js'></script>
(again, you see ‘&‘ instead of just ‘&’)
You can find these issues on: https://forcesail.ru/
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)