WordAds_Amazon

Amazon network class.

Defined (1)

The class is defined in the following location(s).

/modules/wordads/php/networks/amazon.php  
  1. class WordAds_Amazon { 
  2.  
  3. /** 
  4. * Instantiate 
  5. * @since 4.5.0 
  6. */ 
  7. function __construct() { 
  8. add_action( 'wp_head', array( $this, 'insert_head_amazon' ), 25 ); 
  9.  
  10. function insert_head_amazon() { 
  11. $data_tags = ( WordAds_Params::is_cloudflare() ) ? ' data-cfasync="false"' : ''; 
  12. echo <<<HTML 
  13. <script$data_tags type="text/javascript" src="//c.amazon-adsystem.com/aax2/amzn_ads.js"></script> 
  14. <script$data_tags type="text/javascript"> 
  15. try { 
  16. amznads.getAds("3033"); 
  17. } catch(e) { /* ignore */ } 
  18. </script> 
  19. <script$data_tags type="text/javascript"> 
  20. var a9_p = amznads.getKeys(); 
  21. if ("undefined" != typeof a9_p && "" != a9_p && null !== a9_p && "[object Array]" === Object.prototype.toString.call(a9_p)) { 
  22. var a = "",  
  23. b = 0,  
  24. c = a9_p.length,  
  25. d, e; 
  26. a9_p.sort(); 
  27. for (d = 0; d < c; d+=1) { 
  28. a9_p[d - b] = a9_p[d - b].replace(/a1x6p/, "a160x600p"); 
  29. e = a9_p[d - b].split("p"); 
  30. e[0] == a && (a9_p.splice(d - b, 1), b++); 
  31. a = e[0]; 
  32. _ipw_custom.amznPay = a9_p; 
  33. document.close(); 
  34. </script> 
  35. HTML;