SHARE
TWEET

Function for filtering amazon link and a action

a guest Oct 18th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function akram_filtering_posts($content){
  2.  
  3.  
  4.     if(preg_match('(amazon.|amzn.to)', $content) === 1 && !is_admin()) {
  5.  
  6.         echo __('<h4>An Amazon link have found!</h4>');
  7.     }
  8.  
  9.     return $content;
  10.  
  11. }
  12. add_filter('the_content','akram_filtering_posts');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top