onetone_of_get_options

The Onetone onetone of get options function.

Description

onetone_of_get_options( (constant) $default = false ); 

Parameters (1)

0. $default — Optional. (constant) => false
The default.

Usage

  1. if ( !function_exists( 'onetone_of_get_options' ) ) { 
  2. require_once '/includes/theme-setup.php'; 
  3.  
  4. // The default. 
  5. $default = false; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = onetone_of_get_options($default); 
  9.  

Defined (1)

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

/includes/theme-setup.php  
  1. function onetone_of_get_options($default = false) { 
  2.  
  3. global $options_saved, $onetone_default_options; 
  4. $options_saved = false; 
  5. //$optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED.'optionsframework'); 
  6.  
  7. $default_options = optionsframework_options(); 
  8.  
  9. foreach ( (array) $default_options as $option ) { 
  10. if ( ! isset( $option['id'] ) ) { 
  11. continue; 
  12. if ( ! isset( $option['std'] ) ) { 
  13. continue; 
  14. if ( ! isset( $option['type'] ) ) { 
  15. continue; 
  16. $onetone_default_options[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option ); 
  17.  
  18. // Gets the unique option id 
  19. //$option_name = $optionsframework_settings['id']; 
  20.  
  21. $option_name = optionsframework_option_name(); 
  22.  
  23. if ( get_option($option_name) ) { 
  24. $options = get_option($option_name); 
  25. $options_saved = true; 
  26.  
  27. else{ 
  28.  
  29. $options = $onetone_default_options; 
  30.  
  31.  
  32. if ( isset($options) ) { 
  33. return $options; 
  34. } else { 
  35. return $default;