Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

GetMobileApp::can_view()publicWC 1.0

Task visibility. Can view under these conditions:

  • Jetpack is installed and connected && current site user has a wordpress.com account connected to jetpack
  • Jetpack is not connected && current user is capable of installing plugins

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

Хуков нет.

Возвращает

true|false.

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

$GetMobileApp = new GetMobileApp();
$GetMobileApp->can_view();

Код GetMobileApp::can_view() WC 8.7.0

public function can_view() {
	$jetpack_can_be_installed                        = current_user_can( 'manage_woocommerce' ) && current_user_can( 'install_plugins' ) && ! self::is_jetpack_connected();
	$jetpack_is_installed_and_current_user_connected = self::is_current_user_connected();

	return $jetpack_can_be_installed || $jetpack_is_installed_and_current_user_connected;
}