stats_js_remove_stnojs_cookie

Detect if JS is on.

Description

stats_js_remove_stnojs_cookie(); 

Usage

  1. if ( !function_exists( 'stats_js_remove_stnojs_cookie' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/stats.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = stats_js_remove_stnojs_cookie(); 
  7.  

Defined (1)

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

/modules/stats.php  
  1. function stats_js_remove_stnojs_cookie() { 
  2. $parsed = parse_url( admin_url() ); 
  3. ?> 
  4. <script type="text/javascript"> 
  5. /* <![CDATA[ */ 
  6. document.cookie = 'stnojs=0; expires=Wed, 9 Mar 2011 16:55:50 UTC; path=<?php echo esc_js( $parsed['path'] ); ?>'; 
  7. /* ]]> */ 
  8. </script> 
  9. <?php