Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks
AdditionalPayments::can_view()
Task visibility.
Метод класса: AdditionalPayments{}
Хуков нет.
Возвращает
true|false
.
Использование
$AdditionalPayments = new AdditionalPayments(); $AdditionalPayments->can_view();
Код AdditionalPayments::can_view() AdditionalPayments::can view WC 7.3.0
public function can_view() { if ( ! Features::is_enabled( 'payment-gateway-suggestions' ) ) { // Hide task if feature not enabled. return false; } $woocommerce_payments = new WooCommercePayments(); if ( ! $woocommerce_payments->is_requested() || ! $woocommerce_payments->is_supported() || ! $woocommerce_payments->is_connected() ) { // Hide task if WC Pay is not installed via OBW, or is not connected, or the store is located in a country that is not supported by WC Pay. return false; } if ( $this->get_parent_id() === 'extended_two_column' && WooCommercePayments::is_connected() ) { return false; } return true; }