WC_Admin_Reports::get_report()public staticWC 1.0

Get a report from our reports subfolder.

Метод класса: WC_Admin_Reports{}

Хуки из метода

Возвращает

null. Ничего (null).

Использование

$result = WC_Admin_Reports::get_report( $name );
$name(строка) (обязательный)
-

Код WC_Admin_Reports::get_report() WC 8.7.0

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();
}