Files
branddefense.pl/wp-content/plugins/brizy/compatibilities/wp-copyright-protection.php
Roman Pyrih c2e100a763 first commit
2023-07-24 08:30:51 +02:00

19 lines
658 B
PHP

<?php
/**
* Compatibility with LiteSpeed plugin: https://wordpress.org/plugins/wp-copyright-protection/
* This plugin loads a script js which disable the right click on frontend.
* Its purpose is to prevent users from copying the text from the site, a way to prevent copyright.
*/
class Brizy_Compatibilities_WpCopyrightProtection {
public function __construct() {
add_action( 'wp', [ $this, 'disable_js_optimize' ] );
}
public function disable_js_optimize() {
if ( isset( $_GET[ Brizy_Editor::prefix( '-edit' ) ] ) || isset( $_GET[ Brizy_Editor::prefix( '-edit-iframe' ) ] ) ) {
remove_action('wp_head', 'wp_copyright_protection');
}
}
}