stats_dashboard_widget_options
Stats Dashboard Widget Options.
Description
stats_dashboard_widget_options();
Usage
if ( !function_exists( 'stats_dashboard_widget_options' ) ) { require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/stats.php'; } // NOTICE! Understand what this does before running. $result = stats_dashboard_widget_options();
Defined (1)
The function is defined in the following location(s).
- /modules/stats.php
- function stats_dashboard_widget_options() {
- $defaults = array( 'chart' => 1, 'top' => 1, 'search' => 7 );
- if ( ( !$options = get_option( 'stats_dashboard_widget' ) ) || !is_array( $options ) )
- $options = array();
- // Ignore obsolete option values
- $intervals = array( 1, 7, 31, 90, 365 );
- foreach ( array( 'top', 'search' ) as $key )
- if ( isset( $options[$key] ) && !in_array( $options[$key], $intervals ) )
- unset( $options[$key] );
- return array_merge( $defaults, $options );
- }