Change the Payment Error Message that displays on the registration form

The standard message we display when a payment fails during the registration process can be changed with the following code:

1
2
3
4
5
6
7
8
add_filter('pms_payment_error_message', 'pmsc_change_payment_error_message', 20, 2);
function pmsc_change_payment_error_message($error, $is_register) {
	if ($is_register == '1') {
		$error = __('Something went wrong while trying to process the payment. Your account has been created, so please <a href="/login">log in</a> and retry the payment.', 'paid-member-subscriptions');
	} 
 
	return $error;
}

Customize the message from the $error variable.

In this example, I am adding a link to the /login page over the log in words.

Paid Member Subscriptions Pro

Accept (recurring) payments, create subscription plans and restrict content on your website. Easily setup a WordPress membership site using Paid Member Subscriptions.

Unlock PRO Features

Or download FREE version