WC_Admin_Reports::get_report
Get a report from our reports subfolder.
Method of the class: WC_Admin_Reports{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$result = WC_Admin_Reports::get_report( $name );
- $name(string) (required)
- .
WC_Admin_Reports::get_report() WC Admin Reports::get report code WC 10.6.2
public static function get_report( $name ) {
$name = sanitize_title( str_replace( '_', '-', $name ) );
$class = 'WC_Report_' . str_replace( '-', '_', $name );
include_once apply_filters( 'wc_admin_reports_path', 'reports/class-wc-report-' . $name . '.php', $name, $class );
if ( ! class_exists( $class ) ) {
return;
}
$report = new $class();
$report->output_report();
}