WooCommerce Code Reference

WC_Admin_Dashboard
in package

WC_Admin_Dashboard Class.

Table of Contents

__construct()  : mixed
Hook in tabs.
init()  : mixed
Init dashboard widgets.
network_orders()  : mixed
Network orders widget.
recent_reviews()  : mixed
Recent reviews widget.
register_network_order_widget()  : mixed
Register the network order dashboard widget.
status_widget()  : mixed
Show status widget.
get_sales_report_data()  : object
Get sales report data.
get_top_seller()  : object
Get top seller from DB.
get_wc_admin_performance_data()  : stdClass|WP_Error|WP_REST_Response
Gets the sales performance data from the new WooAdmin store.
sales_sparkline()  : string
Overwrites the original sparkline to use the new reports data if WooAdmin is enabled.
should_display_widget()  : bool
Check to see if we should display the widget.
status_widget_order_rows()  : mixed
Show order data is status widget.
status_widget_stock_rows()  : mixed
Show stock data is status widget.

Methods

get_wc_admin_performance_data()

Gets the sales performance data from the new WooAdmin store.

private get_wc_admin_performance_data() : stdClass|WP_Error|WP_REST_Response
Return values
stdClass|WP_Error|WP_REST_Response

sales_sparkline()

Overwrites the original sparkline to use the new reports data if WooAdmin is enabled.

private sales_sparkline(WC_Admin_Report $reports[, bool $is_wc_admin_disabled = false ][, int $id = '' ][, string $type = 'sales' ]) : string

Prepares a sparkline to show sales in the last X days.

Parameters
$reports : WC_Admin_Report

old class for getting reports.

$is_wc_admin_disabled : bool = false

If WC Admin is disabled or not.

$id : int = ''

ID of the product to show. Blank to get all orders.

$type : string = 'sales'

Type of sparkline to get. Ignored if ID is not set.

Return values
string

status_widget_stock_rows()

Show stock data is status widget.

private status_widget_stock_rows(bool $is_wc_admin_disabled) : mixed
Parameters
$is_wc_admin_disabled : bool

if woocommerce admin is disabled.

Return values
mixed