yith_wcwl_get_template

Retrieve a template file.

Description

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

Parameters (3)

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

Usage

  1. if ( !function_exists( 'yith_wcwl_get_template' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yith-woocommerce-wishlist/includes/functions.yith-wcwl.php'; 
  3.  
  4. // The path. 
  5. $path = ''; 
  6.  
  7. // The var. 
  8. $var = null; 
  9.  
  10. // The return. 
  11. $return = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = yith_wcwl_get_template($path, $var, $return); 
  15.  

Defined (1)

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

/includes/functions.yith-wcwl.php  
  1. function yith_wcwl_get_template( $path, $var = null, $return = false ) { 
  2. $located = yith_wcwl_locate_template( $path, $var );  
  3.  
  4. if ( $var && is_array( $var ) ) { 
  5. extract( $var ); 
  6.  
  7. if( $return ) { 
  8. ob_start(); 
  9.  
  10. // include file located 
  11. include( $located ); 
  12.  
  13. if( $return ) { 
  14. return ob_get_clean();