Automattic\WooCommerce\Internal\Admin\Notes

PaymentsRemindMeLater::should_display_note()public staticWC 1.0

Returns true if we should display the note.

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

No Hooks.

Return

true|false.

Usage

$result = PaymentsRemindMeLater::should_display_note();

Код PaymentsRemindMeLater::should_display_note() WC 7.1.0

public static function should_display_note() {
	// Installed WCPay.
	$installed_plugins = PluginsHelper::get_installed_plugin_slugs();
	if ( in_array( 'woocommerce-payments', $installed_plugins, true ) ) {
		return false;
	}
	// Dismissed WCPay welcome page.
	if ( 'yes' === get_option( 'wc_calypso_bridge_payments_dismissed', 'no' ) ) {
		return false;
	}

	// Less than 3 days since viewing welcome page.
	$view_timestamp = get_option( 'wc_pay_welcome_page_viewed_timestamp', false );
	if ( ! $view_timestamp ||
		( time() - $view_timestamp < 3 * DAY_IN_SECONDS )
	) {
		return false;
	}
	return true;
}