stats_upgrade_options

Stats Upgrade Options.

Description

stats_upgrade_options( $options ); 

Parameters (1)

0. $options
The options.

Usage

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

Defined (1)

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

/modules/stats.php  
  1. function stats_upgrade_options( $options ) { 
  2. $defaults = array( 
  3. 'admin_bar' => true,  
  4. 'roles' => array( 'administrator' ),  
  5. 'count_roles' => array(),  
  6. 'blog_id' => Jetpack_Options::get_option( 'id' ),  
  7. 'do_not_track' => true, // @todo 
  8. 'hide_smile' => true,  
  9. ); 
  10.  
  11. if ( isset( $options['reg_users'] ) ) { 
  12. if ( ! function_exists( 'get_editable_roles' ) ) 
  13. require_once( ABSPATH . 'wp-admin/includes/user.php' ); 
  14. if ( $options['reg_users'] ) 
  15. $options['count_roles'] = array_keys( get_editable_roles() ); 
  16. unset( $options['reg_users'] ); 
  17.  
  18. if ( is_array( $options ) && !empty( $options ) ) 
  19. $new_options = array_merge( $defaults, $options ); 
  20. else 
  21. $new_options = $defaults; 
  22.  
  23. $new_options['version'] = STATS_VERSION
  24.  
  25. stats_set_options( $new_options ); 
  26.  
  27.  
  28. return $new_options;