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
__construct()
Hook in tabs.
public
__construct() : mixed
Return values
mixed —init()
Init dashboard widgets.
public
init() : mixed
Return values
mixed —network_orders()
Network orders widget.
public
network_orders() : mixed
Return values
mixed —recent_reviews()
Recent reviews widget.
public
recent_reviews() : mixed
Return values
mixed —register_network_order_widget()
Register the network order dashboard widget.
public
register_network_order_widget() : mixed
Return values
mixed —status_widget()
Show status widget.
public
status_widget() : mixed
Return values
mixed —get_sales_report_data()
Get sales report data.
private
get_sales_report_data() : object
Return values
object —get_top_seller()
Get top seller from DB.
private
get_top_seller() : object
Return values
object —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 —should_display_widget()
Check to see if we should display the widget.
private
should_display_widget() : bool
Return values
bool —status_widget_order_rows()
Show order data is status widget.
private
status_widget_order_rows() : mixed
Return values
mixed —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.