Support » Plugin: WP CDN Rewrite » How to remove ver=xxx from end?

  • Hi,

    I’m trying to remove the ver=xxx from the end of the URL’s given by this plugin. Without the plugin, I just use this in the functions.php file:

    add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
      add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
    
        function remove_cssjs_ver( $src ) {
            if( strpos( $src, '?ver=' ) )
                $src = remove_query_arg( 'ver', $src );
            return $src;
        }

    That works fine. However, as soon as I enable this plugin – that gets overwritten, which means the ver=xxx is added back in. Any ideas on how to do this? I had a look at the code, but couldn’t work it out.

    TIA

    Andy

    https://wordpress.org/plugins/wp-cdn-rewrite/

Viewing 1 replies (of 1 total)
  • Ah – never mind, worked it out. In wp-cdn-rewrite.php, I just commented out:

    //add_filter('style_loader_src', array($this, 'replace_version'), 10);
    			//add_filter('script_loader_src', array($this, 'replace_version'), 10);

    That seems to have done it 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘How to remove ver=xxx from end?’ is closed to new replies.