yit_plugin_get_template

Retrieve a template file.

Description

(string) yit_plugin_get_template( (string) $plugin_basename, (string) $path, (constant) $var = null, (bool) $return = false ); 

Returns (string)

Parameters (4)

0. $plugin_basename (string)
The plugin basename.
1. $path (string)
The path.
2. $var — Optional. (constant) => null
The var.
3. $return — Optional. (bool) => false
The return.

Usage

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

Defined (1)

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

/plugin-fw/yit-functions.php  
  1. function yit_plugin_get_template ( $plugin_basename, $path, $var = null, $return = false ) { 
  2.  
  3. $located = yit_plugin_locate_template ( $plugin_basename, $path, $var ); 
  4.  
  5. if ( $var && is_array ( $var ) ) { 
  6. extract ( $var ); 
  7.  
  8. if ( $return ) { 
  9. ob_start (); 
  10.  
  11. // include file located 
  12. if ( file_exists ( $located ) ) { 
  13. include ( $located ); 
  14.  
  15. if ( $return ) { 
  16. return ob_get_clean ();