Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions

PaymentGatewaysController::possibly_do_connection_return_action()public staticWC 1.0

Call an action after a gating has been successfully returned.

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

Возвращает

null. Ничего.

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

$result = PaymentGatewaysController::possibly_do_connection_return_action();

Код PaymentGatewaysController::possibly_do_connection_return_action() WC 7.1.0

public static function possibly_do_connection_return_action() {
	if (
		! isset( $_GET['page'] ) ||
		'wc-admin' !== $_GET['page'] ||
		! isset( $_GET['task'] ) ||
		'payments' !== $_GET['task'] ||
		! isset( $_GET['connection-return'] ) ||
		! isset( $_GET['_wpnonce'] ) ||
		! wp_verify_nonce( wc_clean( wp_unslash( $_GET['_wpnonce'] ) ), 'connection-return' )
	) {
		return;
	}

	$gateway_id = sanitize_text_field( wp_unslash( $_GET['connection-return'] ) );

	do_action( 'woocommerce_admin_payment_gateway_connection_return', $gateway_id );
}