Created
October 11, 2019 09:16
-
-
Save sudipto-me/454fcf0bafae5f9125c494172d877f15 to your computer and use it in GitHub Desktop.
Disable Right Click for the word press site. Add this code snippet in your theme's functions.php file.
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
function disable_right_click_callback() | |
{ | |
?> | |
<script> | |
jQuery(document).ready(function() { | |
jQuery(document).bind("contextmenu", function(e) { | |
return false; | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_footer', 'disable_right_click_callback'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment