of_get_option

The SKT Parallaxme of get option function.

Description

of_get_option( (string) $name, (bool) $default = false ); 

Parameters (2)

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

Usage

  1. if ( !function_exists( 'of_get_option' ) ) { 
  2. require_once '/inc/options-framework.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 = of_get_option($name, $default); 
  12.  

Defined (1)

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

/inc/options-framework.php  
  1. function of_get_option( $name, $default = false ) { 
  2. $config = get_option( 'optionsframework' ); 
  3.  
  4. if ( ! isset( $config['id'] ) ) { 
  5. return $default; 
  6.  
  7. $options = get_option( $config['id'] ); 
  8.  
  9. if ( isset( $options[$name] ) ) { 
  10. return $options[$name]; 
  11.  
  12. return $default;