onetone_get_default_options

The Onetone onetone get default options function.

Description

onetone_get_default_options(); 

Usage

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

Defined (1)

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

/includes/theme-functions.php  
  1. function onetone_get_default_options() { 
  2. $maybe_options = require_once get_template_directory() .'/includes/admin-options.php'; 
  3. if ( is_array( $maybe_options ) ) { 
  4. $options = $maybe_options; 
  5. } else if ( function_exists( 'optionsframework_options' ) ) { 
  6. $options = optionsframework_options(); 
  7.  
  8. $config = $options; 
  9. $onetone_option_name = optionsframework_option_name(); 
  10. $output = array(); 
  11. foreach ( (array) $config as $option ) { 
  12. if ( ! isset( $option['id'] ) ) { 
  13. continue; 
  14. if ( ! isset( $option['std'] ) ) { 
  15. continue; 
  16. if ( ! isset( $option['type'] ) ) { 
  17. continue; 
  18. $output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option ); 
  19.  
  20. // get default customize data 
  21. if( function_exists('onetone_standard_settings_data') ): 
  22. $customize_options = onetone_standard_settings_data( ); 
  23.  
  24. foreach ( (array) $customize_options as $option ) { 
  25. if ( ! isset( $option['slug'] ) ) { 
  26. continue; 
  27. if ( ! isset( $option['default'] ) ) { 
  28. continue; 
  29. if ( ! isset( $option['type'] ) ) { 
  30. continue; 
  31. $id = str_replace( $onetone_option_name.'[', '', $option['slug']); 
  32. $id = str_replace(']', '', $id ); 
  33. $output[ $id ] = $option['default']; 
  34. endif; 
  35.  
  36. $options = $output; 
  37.  
  38. return $options; 
  39.