I don’t want to be rude but…
-
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)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘I don’t want to be rude but…’ is closed to new replies.