Created
December 21, 2020 19:49
-
-
Save patrickposner/21ca64cb1dd2159a36231e3055cc3619 to your computer and use it in GitHub Desktop.
Logout button for Passster
This file contains 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 | |
// logout button | |
add_shortcode( 'passster-logout', function() { | |
?> | |
<button id="ps-logout">Logout</button> | |
<script> | |
jQuery(document).ready(function( $ ) { | |
$('#ps-logout').on('click', function() { | |
cookie.set('passster', '', { | |
expires: 0, | |
path: '/', | |
}); | |
window.location = "https://my-website.com"; | |
}); | |
}); | |
</script> | |
<?php | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment