WordPress and buddypress programming

How To Disable Text Selection, Copy/Paste, And Right-click wordpress

Viewing 0 reply threads
  • Author
    Posts
    • #3768
      Michael Mc
      Keymaster
      @mkmcst
      function your_function() {
         ?>
      <script>
      jQuery(document).ready(function(){
      function disableselect(e) {
        return false;
      };
      
      function reEnable() {
        return true;
      };
      
      document.onselectstart = new Function ("return false")
      
      if (window.sidebar) {
        document.onmousedown = disableselect
        document.onclick = reEnable
      };
      
          jQuery(document).bind("contextmenu",function(e){
              return false;
          });
          jQuery(document).bind("copy",function(e){
              return false;
          });
         jQuery(document).bind("paste",function(e){
              return false;
          });
         jQuery(document).bind("select",function(e){
              return false;
          });
      });
      </script>
      <?php
      }
      add_action('wp_footer', 'your_function');
Viewing 0 reply threads
  • You must be logged in to reply to this topic.