wp_customize_support_script – do I need it?

Question

I’ve noticed a random JavaScript function at the end of the source code of my WordPress website.

<script type="text/javascript">
    (function() {
        var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|s+)(no-)?'+cs+'(s+|$)');

                request = true;

        b[c] = b[c].replace( rcs, ' ' );
        // The customizer requires postMessage and CORS (if the site is cross domain)
        b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
    }());
</script>

A quick google search lead me to the article below, but I didn’t find it very informative.

https://developer.wordpress.org/reference/functions/wp_customize_support_script/

Does anyone know what exactly this script does, and if it is required?

0
AdamMcquiff 2 months 0 Answers 5 views 0

Leave an answer