Created
October 24, 2024 12:23
-
-
Save abdulawal39/0fb04575c60fea60936efd4083029924 to your computer and use it in GitHub Desktop.
Revisions
-
abdulawal39 created this gist
Oct 24, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ function tnc_support_modify_a_tags() { ?> <script type="text/javascript"> document.addEventListener('DOMContentLoaded', function() { function tnc_support_update_links() { // Find all 'a' tags with the class 'fullscreen-mode' const fullscreenLinks = document.querySelectorAll('a.fullscreen-mode'); // Loop through the NodeList and update the target to '_parent' fullscreenLinks.forEach(function(link) { link.setAttribute('target', '_parent'); }); } // Call the function to update the links tnc_support_update_links(); }); </script> <?php } // Hook it to the WordPress footer or wp_enqueue_scripts action add_action('wp_footer', 'tnc_support_modify_a_tags');