Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Last active November 11, 2020 08:15
Show Gist options
  • Select an option

  • Save patrickposner/1880deef26e9d9f9db26831567f4be77 to your computer and use it in GitHub Desktop.

Select an option

Save patrickposner/1880deef26e9d9f9db26831567f4be77 to your computer and use it in GitHub Desktop.
<?php
add_action('wp_head', 'ps_disable_menu_links' );
function ps_disable_menu_links() {
?>
<script>
jQuery(document).ready(function( $ ) {
let ps_cookie = cookie.get('passster');
if(typeof(ps_cookie) != "undefined" && ps_cookie !== null) {
/* block navigation */
$('.nav li a.hide-item').each(function(){
$(this).attr('href', '#');
$(this).addClass('disable-link');
});
}
});
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment