Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
GetMobileApp::can_view()
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
Method of the class: GetMobileApp{}
No Hooks.
Return
true|false
.
Usage
$GetMobileApp = new GetMobileApp(); $GetMobileApp->can_view();
GetMobileApp::can_view() GetMobileApp::can view code WC 9.7.1
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; }