inkthemes_reset_options

-----------------------------------------------------------------------------------.

Description

inkthemes_reset_options( $options, (string) $page = '' ); 

Parameters (2)

0. $options
The options.
1. $page — Optional. (string) => ''
The page.

Usage

  1. if ( !function_exists( 'inkthemes_reset_options' ) ) { 
  2. require_once '/functions/admin-interface.php'; 
  3.  
  4. // The options. 
  5. $options = null; 
  6.  
  7. // The page. 
  8. $page = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = inkthemes_reset_options($options, $page); 
  12.  

Defined (1)

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

/functions/admin-interface.php  
  1. function inkthemes_reset_options($options, $page = '') { 
  2. global $wpdb; 
  3. $count = 0; 
  4.  
  5. $excludes = array('blogname', 'blogdescription'); 
  6.  
  7.  
  8. foreach ($options as $option) { 
  9.  
  10. if (isset($option['id'])) { 
  11. $option_id = $option['id']; 
  12. $option_type = $option['type']; 
  13.  
  14. //Skip assigned id's 
  15. if (in_array($option_id, $excludes)) { 
  16. continue; 
  17.  
  18. if ($option_type == 'multicheck') { 
  19. foreach ($option['options'] as $option_key => $option_option) { 
  20. inkthemes_delete_option("{$option_id}_{$option_key}"); 
  21. } else if (is_array($option_type)) { 
  22. foreach ($option_type as $inner_option) { 
  23. $option_id = $inner_option['id']; 
  24. inkthemes_delete_option($option_id); 
  25. } else { 
  26. inkthemes_delete_option($option_id); 
  27.  
  28. //When Theme Options page is reset - Add the of_options option 
  29. if ($page == 'optionsframework') { 
  30. inkthemes_delete_option('of_options');