Filter
rpress_is_guest_payment
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#
| Parameter | Type | Description |
|---|---|---|
$is_guest_payment | bool | True when the payment has no linked user. |
$payment_id | int | The 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 1312), inrpress_is_guest_payment()
See also#
Was this page helpful?
