Skip to content
Docs
Get RestroPress

Filter

rpress_update_payment_meta_{$meta_key}

Updated
On this page

Filters a payment meta value before RPRESS_Payment::update_meta saves it, per meta key.

Applied in update_meta just before update_post_meta. Some keys are rewritten first: key and date are folded into the _rpress_payment_meta array, and email values are stored in _rpress_payment_meta as well, so for those the hook name ends with _rpress_payment_meta and the value is the whole array.

Parameters#

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

Return value#

mixed. The value to save.

Example#

function my_update_payment_reference( $meta_value, $payment_id ) {
	return sanitize_text_field( $meta_value );
}
add_filter( 'rpress_update_payment_meta__my_reference', 'my_update_payment_reference', 10, 2 );

Notes#

The hook name is built from the final meta key, so a custom key _my_reference gives rpress_update_payment_meta__my_reference.

Source#

Applied in:

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