Skip to content
Docs
Get RestroPress

Filter

rpress_is_guest_payment

Updated
On this page

Filters whether a payment was placed by a guest.

Runs at the end of rpress_is_guest_payment(). The default is true when the payment has no linked WordPress user ID, false otherwise. The result is cast to a boolean.

Parameters#

ParameterTypeDescription
$is_guest_paymentboolTrue when the payment has no linked user.
$payment_idintThe payment (order) ID.

Return value#

bool. True if the payment is a guest payment.

Example#

add_filter( 'rpress_is_guest_payment', 'my_guest_by_user_meta', 10, 2 );
function my_guest_by_user_meta( $is_guest_payment, $payment_id ) {
	$user_id = rpress_get_payment_user_id( $payment_id );
	if ( $user_id && get_user_meta( $user_id, 'my_is_guest_account', true ) ) {
		return true;
	}
	return $is_guest_payment;
}

Source#

Applied in:

  • includes/payments/functions.php (line 1316), in rpress_is_guest_payment()

See also#

Was this page helpful?