stats_reports_load

Stats Reports Load.

Description

stats_reports_load(); 

Usage

  1. if ( !function_exists( 'stats_reports_load' ) ) { 
  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_reports_load(); 
  7.  

Defined (1)

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

/modules/stats.php  
  1. function stats_reports_load() { 
  2. wp_enqueue_script( 'jquery' ); 
  3. wp_enqueue_script( 'postbox' ); 
  4. wp_enqueue_script( 'underscore' ); 
  5.  
  6.  
  7. if ( isset( $_GET['nojs'] ) && $_GET['nojs'] ) { 
  8. $parsed = parse_url( admin_url() ); 
  9. // Remember user doesn't want JS 
  10. setcookie( 'stnojs', '1', time() + 172800, $parsed['path'] ); // 2 days 
  11.  
  12. if ( isset( $_COOKIE['stnojs'] ) && $_COOKIE['stnojs'] ) { 
  13. // Detect if JS is on. If so, remove cookie so next page load is via JS 
  14. } else if ( !isset( $_GET['noheader'] ) && empty( $_GET['nojs'] ) ) { 
  15. // Normal page load. Load page content via JS.