Filter
rpress_get_payment_meta
On this page
Filters a payment meta value returned by RPRESS_Payment::get_meta.
Applied as the last step of get_meta for every meta key, after the key-specific filter and after unsafe serialized objects have been discarded. Use it when one callback must handle several meta keys.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$meta | mixed | The meta value. |
$payment_id | int | ID of the payment. |
$meta_key | string | The meta key that was requested. |
Return value#
mixed. The meta value to return.
Example#
function my_get_payment_meta( $meta, $payment_id, $meta_key ) {
if ( '_my_reference' === $meta_key && empty( $meta ) ) {
return 'n/a';
}
return $meta;
}
add_filter( 'rpress_get_payment_meta', 'my_get_payment_meta', 10, 3 );
Source#
Applied in:
includes/payments/class-rpress-payment.php(line 1539), inRPRESS_Payment::get_meta()
Was this page helpful?
