Hi
I have a cookie consent pop-up modal enabled on the following site.
Under tab 4, Privacy policy it reads, “You can read about our cookies and privacy settings in detail on our Privacy Policy Page. Privacy Policy”
I notice that the Privacy Policy link opens a new tab which is being flagged as an accessibility issue. My client has asked for ‘target=”_blank”‘ to be removed to fix this issue. It’s automatically populated – can you advise me on how to do this?
Current code below:
<section class="av_tab_section av_tab_section av-av_tab-5f5085d493be16260717094fefe921f3"><div class="tab fullsize-tab active_tab" role="tab" tabindex="0" data-fake-id="#tab-id-4" aria-controls="tab-id-4-content" aria-hidden="false">Privacy Policy</div><div id="tab-id-4-content" class="tab_content active_tab_content" aria-hidden="false" style="min-height: 1px;"><div class="tab_inner_content invers-color"><p>You can read about our cookies and privacy settings in detail on our Privacy Policy Page. </p>
<a href="https://owe.brother.design/privacy-policy/" target="_blank" role="link">Privacy Policy</a>
</div></div></section>
Thanks in advance
Whoops – just activating email notifications!
Anyone had any ideas?
Hi,
Unfortunately, there isn’t an easy way to remove the target attribute at the moment. I will ask our developers if it’d be possible to add a filter for upcoming versions. We’ll give you an update in case we add a new filter.
For now, please add the following code to the bottom of Functions.php file of your child theme, or add it as a new snippet in the Code Snippets plugin:
function av_remove_privacy_attr() {
?>
<script>
(function($) {
$(document).ready(function() {
$('.av-av_tab-5f5085d493be16260717094fefe921f3 a').removeAttr('target');
});
}(jQuery));
</script>
<?php
}
add_action('wp_footer', 'av_remove_privacy_attr');
Best regards,
Yigit
Thanks Yigit
That worked.
Dominic