Old answer (based on misconception that you wanted a cache buster): You can use add_query_arg() which adds/replaces query arguments.
<?php
/**
* Plugin Name: wpse_84670
* Version: 0.0.1
* Description: replace script/style version with time as a cache buster
*/
/**
* replace script or stylesheet version with current time
* @param string $url the source URL
* @return string
*/
function wpse_84670_time_as_version($url) {
return add_query_arg(array('ver' => time()), $url);
}
add_filter('script_loader_src', 'wpse_84670_time_as_version');
add_filter('style_loader_src', 'wpse_84670_time_as_version');
New answer: don’t do that! It will force a file access for every enqueued script and stylesheet on a page, and depending on what plugins you have activated that could mean an additional dozen or more file accesses for every access to a page/post. Many of them won’t even result in the browser requesting those files (if you have expired times configured for scripts and stylesheets — and you should!)
Instead, just wrap a function around your enqueuing code for your theme, so that you only make a file access for the files your theme enqueues.
Better still, keep a rolling version number in your theme (in my themes, I call it $forceLoad
) and use that as the version passed to wp_enqueue_script. No additional file access required.
$forceLoad = '42';
wp_enqueue_style('fstop-stylesheet', get_stylesheet_directory_uri() . '/library/css/style.css', false, $forceLoad, 'all');