Automattic\WooCommerce\Internal\Admin
WcPayWelcomePage::is_incentive_visible()
Whether the WooPayments incentive should be visible.
Метод класса: WcPayWelcomePage{}
Хуки из метода
Возвращает
true|false
.
Использование
$WcPayWelcomePage = new WcPayWelcomePage(); $WcPayWelcomePage->is_incentive_visible( $skip_wcpay_active ): bool;
- $skip_wcpay_active(true|false)
- Whether to skip the check for the WooPayments plugin being active.
По умолчанию: false
Код WcPayWelcomePage::is_incentive_visible() WcPayWelcomePage::is incentive visible WC 9.5.1
public function is_incentive_visible( bool $skip_wcpay_active = false ): bool { // The WooPayments plugin must not be active. if ( ! $skip_wcpay_active && $this->is_wcpay_active() ) { return false; } // The current WP user must have the capabilities required to set up WooPayments. if ( ! current_user_can( 'manage_woocommerce' ) ) { return false; } // Suggestions not disabled via a setting. if ( get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) === 'no' ) { return false; } /** * Filter allow marketplace suggestions. * * User can disable all suggestions via filter. * * @since 3.6.0 */ if ( ! apply_filters( 'woocommerce_allow_marketplace_suggestions', true ) ) { return false; } // An incentive must be available. if ( empty( $this->get_incentive() ) ) { return false; } // Incentive not manually dismissed. if ( $this->is_incentive_dismissed() ) { return false; } return true; }