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(): bool;

Код WcPayWelcomePage::must_be_visible() WC 8.1.1

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