PHP 362
RC No Copy - Updated Guest on 15th August 2021 11:42:25 AM
  • Copy
  1. <?php
  2. /**
  3.  * @since             1.0.0
  4.  * @package           RC_No_Copy
  5.  * @wordpress-plugin
  6.  * Plugin Name:       RC - NoCopy
  7.  * Description:       Disable Text Selection,Right Click, and CTRL + S, U, I, A, P, F12
  8.  * Version:           4.0.0
  9.  * Author:            Razvan Cilibeanu
  10.  * Author URI:        razvancilibeanu.com
  11.  * Text Domain:       no-copy
  12.  */
  13. // If this file is called directly, abort.
  14. if ( ! defined( 'WPINC' ) ) {
  15.         die;
  16. }
  17.  
  18.  
  19. add_action('init', function() {
  20.   if (function_exists('is_user_logged_in')){
  21.         if (is_user_logged_in()) {
  22.        
  23.         }else{
  24.            
  25.                
  26.                
  27. add_action('wp_head', 'prevent_copy');
  28.    function prevent_copy()
  29.       { echo "   <SCRIPT>document.addEventListener('contextmenu',e=>e.preventDefault()),document.onkeydown=function(e){if((e=e||window.event).ctrlKey)switch(e.which||e.keyCode){case 83:case 85:case 73:case 67:case 65:case 80:case 87:case 123:e.preventDefault(),e.stopPropagation()}};(function($){ $(document).keydown(function (event) {if (event.keyCode == 123) {return false;}});})(jQuery);</SCRIPT><script type='text/javascript'>if ( window.self !== window.top ) {    window.top.location.href=window.location.href;}</script><style>* {-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: -moz-none;-o-user-select: none;user-select: none;}</Style>"; }
  30.                
  31.       }
  32.         }
  33.   }
  34. );

YourPastebin.com allows you to store & share text/code.

Privacy Policy | Report Abuse


Powered by Exypnos Digital