yit_layout_option

Retrieve a layout option.

Description

(array) yit_layout_option( $key, (constant) $id = false, (string) $type = 'post', (string) $model = 'post_type' ); 

Returns (array)

Parameters (4)

0. $key
The key.
1. $id — Optional. (constant) => false
The id.
2. $type — Optional. (string) => 'post'
The type.
3. $model — Optional. (string) => 'post_type'
The model.

Usage

  1. if ( !function_exists( 'yit_layout_option' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-compare/plugin-fw/yit-functions.php'; 
  3.  
  4. // The key. 
  5. $key = null; 
  6.  
  7. // The id. 
  8. $id = false; 
  9.  
  10. // The type. 
  11. $type = 'post'; 
  12.  
  13. // The model. 
  14. $model = 'post_type'; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = yit_layout_option($key, $id, $type, $model); 
  18.  

Defined (1)

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

/plugin-fw/yit-functions.php  
  1. function yit_layout_option ( $key, $id = false, $type = "post", $model = "post_type" ) { 
  2.  
  3. $option = ''; 
  4.  
  5. if ( defined ( 'YIT' ) ) { 
  6. $option = YIT_Layout_Panel ()->get_option ( $key, $id, $type, $model ); 
  7. } else { 
  8. if ( ! $id && ( is_single () || is_page () ) ) { 
  9. global $post; 
  10. $id = $post->ID; 
  11. } elseif ( $id != 'all' ) { 
  12. $option = get_post_meta ( $id, $key ); 
  13.  
  14. return $option;