WC_Admin_Dashboard_Setup::should_display_widget()publicWC 1.0

Check to see if we should display the widget

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

No Hooks.

Return

true|false.

Usage

$WC_Admin_Dashboard_Setup = new WC_Admin_Dashboard_Setup();
$WC_Admin_Dashboard_Setup->should_display_widget();

Code of WC_Admin_Dashboard_Setup::should_display_widget() WC 6.7.0

public function should_display_widget() {
	if ( ! class_exists( 'Automattic\WooCommerce\Admin\Features\Features' ) || ! class_exists( 'Automattic\WooCommerce\Admin\Features\OnboardingTasks\TaskLists' ) ) {
		return false;
	}

	if ( ! Features::is_enabled( 'onboarding' ) || ! WC()->is_wc_admin_active() ) {
		return false;
	}

	if ( ! current_user_can( 'manage_woocommerce' ) ) {
		return false;
	}

	if ( ! $this->get_task_list() || $this->get_task_list()->is_complete() || $this->get_task_list()->is_hidden() ) {
		return false;
	}

	return true;
}