<?php// Conditionally display a persistent notice on the Single Product screenfunctioncustom_woocommerce_before_main_content(){// Check that we are on the Single Product screenif(!is_product())return;// Check if the referrer is availableif(!isset($_SERVER['HTTP_REFERER']))return;// Check if the referrer is a known nulled script site$is_nuller=false;$known_nullers=array('dtywn.com','null24.net','themes24x7.com');// Check the referrer against known nulled script sitesforeach($known_nullersas$known_nuller){if(strpos($_SERVER['HTTP_REFERER'],$known_nuller)!==false){$is_nuller=true;break;}}// Bail out if there is no matchif(!$is_nuller)return;$text='Hi there, I hope you are scanning those nulled Plugins for malware before installing them! Here is a 20% discount if you need future Plugin support.';echo'<div class="woocommerce-message"> '.$text.' <strong>;)</strong></div> ';}add_action('woocommerce_before_main_content','custom_woocommerce_before_main_content');?>
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.