wp_enqueue_script ver keeps showing up
-
Hi, when I use wp_enqueue_script to include my own JS it keeps uppending
?ver=2.9.2
to the end of the link, I’ve tryed everething, evenwp_enqueue_script('active_content_check', '/wp-content/themes/runner/engine/video/AC_RunActiveContent.js', false, false, false );
The resulting source is:
<script type='text/javascript' src='http://localhost/wordpress/wp-content/themes/runner/engine/video/AC_RunActiveContent.js?ver=2.9.2'></script>
And obviously my js doen’t get to work, since it doesn’t expect some crasy numbers (WordPress version) on the end of it’s name. I’ve seen many people write about this problem, but not a single solution, accept for add_filter, which did not work. The code I’ve tryed was:
add_action('init', 'Active_Content_script'); function Active_Content_script() { wp_enqueue_script('active_content_check', '/wp-content/themes/runner/engine/video/AC_RunActiveContent.js', false, false, false ); } add_filter('Active_Content_script', 'toscho_script_loader_filter'); function toscho_script_loader_filter($src) { if ( FALSE === strpos($src, 'http://ajax.googleapis.com/') ) { return $src; } $new_src = explode('?', $src); return $new_src[0]; }
Please help!!!!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘wp_enqueue_script ver keeps showing up’ is closed to new replies.