@
@
@eashla2017-02-19 00:59:44
JavaScript
@eashla, 2017-02-19 00:59:44

How to remove "?ver=" from the file name?

Good afternoon!
CMS Wordpress and there are embedded emoticons in it. They are pulled by a script (if I understand correctly)
https://site.com/wp-includes/js/wp-emoji-release.m... I
use CDN for all content, including js
The GTmetrix service tells me the following:

Using a CDN YSlow doesn't recognize? Specify your CDNs in your User Settings.

There are 4 static components that are not on CDN.
https://site.com/wp-includes/js/wp-emoji-release.min.js?ver=4.7.2

From this it is clear that the file is not being pulled by the CDN and it seems to me that the reason is ?ver=4.7.2 . Forming a version at the end of the file spoils the appearance of the extension and the CDN does not understand what it is and therefore does not pull it up.
Question - how to remove version generation at the end of the file?
ps I'm not going to delete emoticons, they are needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2017-02-19
_

versions are removed like this

function remove_version_from_style_js($src) {
        $src = remove_query_arg( 'ver', $src );
        return $src;
    }

    add_filter( 'style_loader_src', 'remove_version_from_style_js' );
    add_filter( 'script_loader_src', 'remove_version_from_style_js' );

And why do you need emoji?
You can also disable them https://plugins.svn.wordpress.org/disable-emojis/t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question