Created
February 9, 2021 05:52
-
-
Save hamidrezayazdani/80847b5bab3e2a2948991d8068b4391b to your computer and use it in GitHub Desktop.
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 | |
add_action( 'wp_footer', 'ywp_goftino_auto_pm' ); | |
function ywp_goftino_auto_pm() { | |
echo '<script> | |
if (!localStorage.getItem("goftino_timing") || new Date().getTime() - localStorage.getItem("goftino_timing") >= 60000*24*60){ | |
localStorage.setItem("goftino_timing", new Date().getTime()); | |
localStorage.removeItem("goftino_autopm"); | |
} | |
</script>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment