WC_Admin_Dashboard::should_display_widget()privateWC 1.0

Check to see if we should display the widget.

{} It's a method of the class: WC_Admin_Dashboard{}

No Hooks.

Return

true|false.

Usage

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

Code of WC_Admin_Dashboard::should_display_widget() WC 6.7.0

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

	$has_permission           = current_user_can( 'view_woocommerce_reports' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'publish_shop_orders' );
	$task_completed_or_hidden = 'yes' === get_option( 'woocommerce_task_list_complete' ) || 'yes' === get_option( 'woocommerce_task_list_hidden' );
	return $task_completed_or_hidden && $has_permission;
}