Last active
November 11, 2020 08:15
-
-
Save patrickposner/1880deef26e9d9f9db26831567f4be77 to your computer and use it in GitHub Desktop.
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 characters
| <?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