Automattic\WooCommerce\Internal\Admin

WcPayWelcomePage::must_be_visible()publicWC 1.0

Whether the WooPayments welcome page should be visible.

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

Хуки из метода

Возвращает

true|false.

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

$WcPayWelcomePage = new WcPayWelcomePage();
$WcPayWelcomePage->must_be_visible( $skip_wcpay_active ): bool;
$skip_wcpay_active(true|false)
Whether to skip the check for the WooPayments plugin being active.
По умолчанию: false

Код WcPayWelcomePage::must_be_visible() WC 9.3.3

public function must_be_visible( $skip_wcpay_active = false ): bool {
	// The WooPayments plugin must not be active.
	if ( ! $skip_wcpay_active && $this->is_wcpay_active() ) {
		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;
}