Skip to content

Instantly share code, notes, and snippets.

@abdulawal39
Created November 13, 2023 11:19
Show Gist options
  • Save abdulawal39/b6bacbee70e698abfca74a05a88ccb21 to your computer and use it in GitHub Desktop.
Save abdulawal39/b6bacbee70e698abfca74a05a88ccb21 to your computer and use it in GitHub Desktop.
Disable Text Selection on TNC FlipBook - PDF viewer for WordPress Plugin
/**
* Add the following code in your active theme's functions.php file
*/
function tnc_pvfw_disable_text_selection_script() {
?>
<script>
document.addEventListener('DOMContentLoaded', function () {
document.body.style.userSelect = 'none';
});
</script>
<?php
}
add_action('tnc_pvfw_footer', 'tnc_pvfw_disable_text_selection_script');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment