• Resolved Jason Wong

    (@eljkmw)


    G’day Scott,

    I noticed that your plugin could include another feature to the remove WP versions from all CSS headers. At this moment, I’d to add the following code into the active theme’s functions.php

    // Remove WP version param from any enqueued scripts
    function vc_remove_wp_ver_css_js( $src ) {
    	if ( strpos( $src, 'ver=' ) )
    		$src = remove_query_arg( 'ver', $src );
    	return $src;
    }
    add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
    add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );

    This will beef-up your plugin 🙂

    Cheers,
    Jason

    https://wordpress.org/plugins/rs-head-cleaner/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor redsand

    (@redsand)

    Hi Jason,

    Good call. I had noticed that the versions added to the CSS keeps it from validating.

    Let me just check into it and double-check that it won’t affect any WP functionality, and I’ll be happy to add that to the next version. That would be great to remove the WP ver number form there too. WP’s default setup seems like it would slow down a page at least a little because it won’t let the browser use cached versions of the css as it stands.

    Thanks for sharing your code! It should provide both security and speed improvements.

    – Scott

    Plugin Contributor redsand

    (@redsand)

    Hey Jason,

    I just released the new version with this implemented. Thanks again for the suggestion. 🙂

    Thread Starter Jason Wong

    (@eljkmw)

    You’re welcome, Scott.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Next release to include Remove Version from CSS’ is closed to new replies.