wc_admin_reports_path

The WooCommerce wc admin reports path hook.

Description

apply_filters( 'wc_admin_reports_path', (string) $reports_class_wc_report_name_php, (string) $name, (unknown) $class ); 

Parameters (3)

0. $reports_class_wc_report_name_php (string) => 'reports/class-wc-report-' . $name . '.php'
The reports class wc report name php.
1. $name (string)
The name.
2. $class (unknown)
The class.

Usage

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

Defined (1)

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

/includes/admin/class-wc-admin-reports.php  
  1. include_once( apply_filters( 'wc_admin_reports_path', 'reports/class-wc-report-' . $name . '.php', $name, $class ) );