• Resolved Salvatore Noschese

    (@salvatorenoschese)


    I seen your code and there is a lot of php, js, css, png…
    Atm in my blog i just use this (as mu-plugin) and seems to work so good.

    Is there any benefits to switch in your plugin? Ty ??

    <?php
    /* Force Target _blank */

    defined( 'ABSPATH' ) || exit;
    add_action('wp_footer', function() { ?>
    <script data-no-optimize="1">
    (function () {
    var targetBlankPluginLinks = document.querySelectorAll('a[href^="https://"]');
    targetBlankPluginLinks.forEach(function (targetBlankPluginLink) {
    if (targetBlankPluginLink.hostname !== window.location.hostname) {
    targetBlankPluginLink.setAttribute('target', '_blank');
    }
    });
    })();
    </script>
    <?php
    });
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    Well, if you already have something that works, I don’t understand your question ??

    The plugin is intended for people that want to do something simmilar but don’t want to bother with code.

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    To clarify, I wasn’t sure if I wanted to keep that code on my blog to continue forcing users (which, in fact, I removed last night).

    So, I did some research online and came across your plugin. I thought it might be something simple like what I had, but instead, I noticed it has a lot more code.

    This sparked my curiosity, as I wondered if it might offer additional benefits, like more checks or other features.

    I hope this clears up my question.

    Thank you for your time! ??

    Plugin Author Alexandru Tapuleasa

    (@talextech)

    It doesn’t really have much extra. The extra code is mostly for the interface and targetting links based on the custom query selector entered by the user ??

    Thread Starter Salvatore Noschese

    (@salvatorenoschese)

    Ok, TYSM, really appreciated. Best regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I don’t want to be rude but…’ is closed to new replies.