WC_Admin_Dashboard::should_display_widgetprivateWC 1.0

Check to see if we should display the widget.

Method of the class: WC_Admin_Dashboard{}

No Hooks.

Returns

true|false.

Usage

// private - for code of main (parent) class only
$result = $this->should_display_widget();

WC_Admin_Dashboard::should_display_widget() code WC 11.0.1

private function should_display_widget() {
	if ( ! WC()->is_wc_admin_active() ) {
		return false;
	}

	return current_user_can( 'view_woocommerce_reports' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'publish_shop_orders' );
}