Automattic\WooCommerce\Admin\API

LaunchYourStore::must_be_shop_manager_or_admin()publicWC 1.0

User must be either shop_manager or administrator.

Method of the class: LaunchYourStore{}

No Hooks.

Return

true|false.

Usage

$LaunchYourStore = new LaunchYourStore();
$LaunchYourStore->must_be_shop_manager_or_admin();

LaunchYourStore::must_be_shop_manager_or_admin() code WC 9.6.0

public function must_be_shop_manager_or_admin() {
	// phpcs:ignore
	if ( ! current_user_can( 'manage_woocommerce' ) && ! current_user_can( 'administrator' ) ) {
		return false;
	}
	return true;
}