stats_configuration_load

Stats Configuration Load.

Description

stats_configuration_load(); 

Usage

  1. if ( !function_exists( 'stats_configuration_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_configuration_load(); 
  7.  

Defined (1)

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

/modules/stats.php  
  1. function stats_configuration_load() { 
  2. if ( isset( $_POST['action'] ) && $_POST['action'] == 'save_options' && $_POST['_wpnonce'] == wp_create_nonce( 'stats' ) ) { 
  3. $options = stats_get_options(); 
  4. $options['admin_bar'] = isset( $_POST['admin_bar'] ) && $_POST['admin_bar']; 
  5. $options['hide_smile'] = isset( $_POST['hide_smile'] ) && $_POST['hide_smile']; 
  6.  
  7. $options['roles'] = array( 'administrator' ); 
  8. foreach ( get_editable_roles() as $role => $details ) 
  9. if ( isset( $_POST["role_$role"] ) && $_POST["role_$role"] ) 
  10. $options['roles'][] = $role; 
  11.  
  12. $options['count_roles'] = array(); 
  13. foreach ( get_editable_roles() as $role => $details ) 
  14. if ( isset( $_POST["count_role_$role"] ) && $_POST["count_role_$role"] ) 
  15. $options['count_roles'][] = $role; 
  16.  
  17. stats_set_options( $options ); 
  18. Jetpack::state( 'message', 'module_configured' ); 
  19. wp_safe_redirect( Jetpack::module_configuration_url( 'stats' ) ); 
  20. exit;