stats_dashboard_widget_options

Stats Dashboard Widget Options.

Description

stats_dashboard_widget_options(); 

Usage

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

Defined (1)

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

/modules/stats.php  
  1. function stats_dashboard_widget_options() { 
  2. $defaults = array( 'chart' => 1, 'top' => 1, 'search' => 7 ); 
  3. if ( ( !$options = get_option( 'stats_dashboard_widget' ) ) || !is_array( $options ) ) 
  4. $options = array(); 
  5.  
  6. // Ignore obsolete option values 
  7. $intervals = array( 1, 7, 31, 90, 365 ); 
  8. foreach ( array( 'top', 'search' ) as $key ) 
  9. if ( isset( $options[$key] ) && !in_array( $options[$key], $intervals ) ) 
  10. unset( $options[$key] ); 
  11.  
  12. return array_merge( $defaults, $options );