onetone_save_options

// save options.

Description

onetone_save_options(); 

Usage

  1. if ( !function_exists( 'onetone_save_options' ) ) { 
  2. require_once '/includes/theme-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = onetone_save_options(); 
  7.  

Defined (1)

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

/includes/theme-functions.php  
  1. function onetone_save_options() { 
  2.  
  3. global $onetone_options_saved, $onetone_default_options, $onetone_home_sections; 
  4.  
  5. $nonce = $_REQUEST['_wpnonce']; 
  6.  
  7. if ( ! wp_verify_nonce( $nonce, 'optionsframework-options' ) ) { 
  8.  
  9. die( 'Security check' );  
  10.  
  11. } else { 
  12.  
  13. $option_name = optionsframework_option_name(); 
  14. $options = get_option( $option_name ) ; 
  15.  
  16. if( !$options ): 
  17.  
  18. $options = $onetone_default_options; 
  19. update_option( $option_name, $options );  
  20.  
  21. endif; 
  22.  
  23. //update font color options 
  24. for($i=0;$i<$section_num;$i++) {  
  25.  
  26. if(isset($options['section_color_'.$i]) && $i !== 0): 
  27. if( $options['section_content_model_'.$i]== '0' && $options['section_color_'.$i] !== '') { 
  28. $options['section_content_typography_'.$i]['color'] = $options['section_color_'.$i]; 
  29.  
  30. endif; 
  31.  
  32. if(!isset($options['section_subtitle_typography_'.$i]) && isset($onetone_default_options['section_subtitle_typography_'.$i])): 
  33.  
  34. $options['section_subtitle_typography_'.$i] = $onetone_default_options['section_subtitle_typography_'.$i]; 
  35.  
  36. endif; 
  37.  
  38. if( isset($_POST[$option_name])): 
  39.  
  40. foreach( $_POST[$option_name] as $k => $v ) { 
  41.  
  42. if( is_array($v) ) { 
  43.  
  44. foreach( $v as $k1=>$v1) { 
  45.  
  46. $options[$k][$k1] = stripslashes($v1); 
  47.  
  48.  
  49. }else{ 
  50. $options[$k] = stripslashes($v); 
  51.  
  52.  
  53.  
  54. update_option( $option_name, $options );  
  55.  
  56. endif; 
  57.  
  58. exit(0);