Skip to content
Docs
Get RestroPress

Filter

rpress_rpress_update_payment_meta_{$meta_key}

Updated
On this page

Filters a payment email value before it is saved by RPRESS_Payment::update_meta.

Applied in update_meta only when the meta key is email or _rpress_payment_user_email. The value is then saved as the _rpress_payment_user_email meta and copied into the user_info of the payment meta. The doubled rpress_ prefix in the hook name is part of the actual name.

Parameters#

ParameterTypeDescription
$meta_valuemixedThe email value about to be saved.
$payment_idintID of the payment.

Return value#

mixed. The value to save.

Example#

function my_normalize_payment_email( $meta_value, $payment_id ) {
	return strtolower( trim( $meta_value ) );
}
add_filter( 'rpress_rpress_update_payment_meta_email', 'my_normalize_payment_email', 10, 2 );

Notes#

Only two concrete names are ever fired: rpress_rpress_update_payment_meta_email and rpress_rpress_update_payment_meta__rpress_payment_user_email. The general rpress_update_payment_meta_{$meta_key} filter also runs afterwards.

Source#

Applied in:

  • includes/payments/class-rpress-payment.php (line 1564), in RPRESS_Payment::update_meta()
Was this page helpful?