of_option_setup

The ColorWay Theme of option setup function.

Description

of_option_setup(); 

Usage

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

Defined (1)

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

/functions/admin-functions.php  
  1. function of_option_setup() { 
  2.  
  3. //Update EMPTY options 
  4. $of_array = array(); 
  5. add_option('of_options', $of_array); 
  6.  
  7. $template = get_option('of_template'); 
  8. $saved_options = get_option('of_options'); 
  9.  
  10. foreach($template as $option) { 
  11. if($option['type'] != 'heading') { 
  12. $id = $option['id']; 
  13. $std = $option['std']; 
  14. $db_option = get_option($id); 
  15. if(empty($db_option)) { 
  16. if(is_array($option['type'])) { 
  17. foreach($option['type'] as $child) { 
  18. $c_id = $child['id']; 
  19. $c_std = $child['std']; 
  20. update_option($c_id, $c_std); 
  21. $of_array[$c_id] = $c_std;  
  22. } else { 
  23. update_option($id, $std); 
  24. $of_array[$id] = $std; 
  25. else { //So just store the old values over again. 
  26. $of_array[$id] = $db_option; 
  27. update_option('of_options', $of_array);