evolve_get_option

Get Option.

Description

evolve_get_option( (string) $name, (constant) $default = false ); 

Helper function to return the theme option value. If no value has been saved, it returns $default. Needed because options are as serialized strings.

Parameters (2)

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

Usage

  1. if ( !function_exists( 'evolve_get_option' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // The name. 
  5. $name = ''; 
  6.  
  7. // The default. 
  8. $default = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = evolve_get_option($name, $default); 
  12.  

Defined (1)

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

/functions.php  
  1. function evolve_get_option($name, $default = false) { 
  2. $config = get_option('evolve'); 
  3.  
  4. if (!isset($config['id'])) { 
  5. //return $default; 
  6. global $evl_options; 
  7.  
  8. $options = $evl_options; 
  9. if (isset($GLOBALS['redux_compiler_options'])) { 
  10. $options = $GLOBALS['redux_compiler_options']; 
  11.  
  12. if (isset($options[$name])) { 
  13. $mediaKeys = array( 
  14. 'evl_bootstrap_slide1_img',  
  15. 'evl_bootstrap_slide2_img',  
  16. 'evl_bootstrap_slide3_img',  
  17. 'evl_bootstrap_slide4_img',  
  18. 'evl_bootstrap_slide5_img',  
  19. 'evl_content_background_image',  
  20. 'evl_favicon',  
  21. 'evl_footer_background_image',  
  22. 'evl_header_logo',  
  23. 'evl_scheme_background',  
  24. 'evl_slide1_img',  
  25. 'evl_slide2_img',  
  26. 'evl_slide3_img',  
  27. 'evl_slide4_img',  
  28. 'evl_slide5_img',  
  29. ); 
  30. // Media SHIM 
  31. if (in_array($name, $mediaKeys)) { 
  32. if (is_array($options[$name])) { 
  33. return isset($options[$name]['url']) ? $options[$name]['url'] : false; 
  34. } else { 
  35. return $options[$name]; 
  36.  
  37. return $options[$name]; 
  38.  
  39. return $default;