wc_get_template

The WooCommerce wc get template hook.

Description

apply_filters( 'wc_get_template', (unknown) $located, (string) $template_name, (unknown) $args, (unknown) $template_path, (unknown) $default_path ); 

Parameters (5)

0. $located (unknown)
The located.
1. $template_name (string)
The template name.
2. $args (unknown)
The args.
3. $template_path (unknown)
The template path.
4. $default_path (unknown)
The default path.

Usage

To run the hook, copy the example below.
  1. $located = apply_filters( 'wc_get_template', $located, $template_name, $args, $template_path, $default_path ); 
  2.  
  3. if ( !empty( $located ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wc_get_template callback 
  2. function filter_wc_get_template( $located, $template_name, $args, $template_path, $default_path ) { 
  3. // make filter magic happen here... 
  4. return $located
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wc_get_template', 'filter_wc_get_template', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wc_get_template', 'filter_wc_get_template', 10, 5 ); 

Defined (1)

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

/includes/wc-core-functions.php  
  1. $located = apply_filters( 'wc_get_template', $located, $template_name, $args, $template_path, $default_path );