• Resolved Websonica

    (@websonica)


    Hi, one of my sites with this module loads a big js script in the html of each page. Is there a way to make it load only in admin? that’s where I actually use it

Viewing 1 replies (of 1 total)
  • Plugin Support Robert

    (@robertnextendweb)

    Hi @websonica

    We do load our scripts and styles on all pages by default, because we cannot prepare in advance where the social buttons may show up. Our assets are tiny, and should not cause any disturbance on your website, but if you insist on removing them on certain pages, you could do so with some custom coding.

    You can remove them like this:

    add_action('wp', function () {
    NextendSocialLogin::removeFrontendAssets();
    });

    But in its current state, this code will remove our styles and scripts from all pages regardless you are logged in or not, which means:

    • the buttons will look completely broken without the styles
    • the buttons will simply trigger redirects instead of opening a popup
    • some redictions won’t work
    • the redirect overlay won’t show up
    • our WebView based codes won’t be able to limit the buttons that don’t support WebVivew, etc.

    However please note that, this requires some developer experience, as we can not provide support for custom coding and problems caused by your custom codes!

Viewing 1 replies (of 1 total)

The topic ‘How to remove inline script where not used’ is closed to new replies.