Automattic\WooCommerce\Internal\Admin\Settings

PaymentProviders::is_payment_extension_suggestion_hidden()privateWC 1.0

Check if a payment extension suggestion has been hidden by the user.

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

Хуков нет.

Возвращает

true|false. True if the extension suggestion is hidden, false otherwise.

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

// private - только в коде основоного (родительского) класса
$result = $this->is_payment_extension_suggestion_hidden( $extension ): bool;
$extension(массив) (обязательный)
The extension suggestion.

Код PaymentProviders::is_payment_extension_suggestion_hidden() WC 9.6.1

private function is_payment_extension_suggestion_hidden( array $extension ): bool {
	$user_payments_nox_profile = get_user_meta( get_current_user_id(), Payments::USER_PAYMENTS_NOX_PROFILE_KEY, true );
	if ( empty( $user_payments_nox_profile ) ) {
		return false;
	}
	$user_payments_nox_profile = maybe_unserialize( $user_payments_nox_profile );

	if ( empty( $user_payments_nox_profile['hidden_suggestions'] ) ) {
		return false;
	}

	return in_array( $extension['id'], array_column( $user_payments_nox_profile['hidden_suggestions'], 'id' ), true );
}