WC_Admin_Dashboard_Setup::should_display_widget()publicWC 1.0

Check to see if we should display the widget

Метод класса: WC_Admin_Dashboard_Setup{}

Хуков нет.

Возвращает

true|false.

Использование

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

Код WC_Admin_Dashboard_Setup::should_display_widget() WC 7.1.1

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;
}