wcdn_template_file_name

The WooCommerce Print Invoices & Delivery Notes wcdn template file name hook.

Description

apply_filters( 'wcdn_template_file_name', (string) $print_this_template_type_php, (unknown) $template_type, (unknown) $order_id, (unknown) $instance ); 

Parameters (4)

0. $print_this_template_type_php (string) => 'print-' . $this->template_type . '.php'
The print this template type php.
1. $template_type (unknown)
The template type.
2. $order_id (unknown)
The order id.
3. $instance (unknown)
The this.

Usage

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

Defined (1)

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

/classes/class-wcdn-print.php  
  1. $this->get_template( apply_filters( 'wcdn_template_file_name', 'print-' . $this->template_type . '.php', $template_type, $order_id, $this ) );