Attenzione!

Questo articolo contiene codice PHP ed è destinato agli sviluppatori. Offriamo questo codice come cortesia, ma non forniamo supporto per personalizzazioni del codice o sviluppo di terze parti.

Per ulteriore assistenza, consulta il tutorial di WPBeginner su come aggiungere codice personalizzato.

Chiudi

Descrizione

The wpforms_forms_submission_prepare_payment_meta filter fires when the payment is ready to be saved into the payments_meta table.

Parametri

$payment_meta
(array) Payment meta that will be saved into the database (payments_meta) table.
$fields
(array) Valori/proprietà dei campi dell'invio sanificati.
$form_data
(array) Impostazioni/dati del modulo elaborati, preparati per l'uso successivo.

Origine

wpforms/src/Forms/Submission.php

Maggiori Informazioni

The filter fires when the payment is ready to be saved into the payments_meta table.

Esempi

/**
 * Payment meta that is ready to be saved into the payments_meta table.
 *
 * @link  https://wpforms.com/developers/wpforms_forms_submission_prepare_payment_meta/
 *
 * @param array  $payment_meta   Payment meta that will be saved into the database (payments_meta) table.
 * @param array  $fields         Sanitized entry field values/properties.
 * @param array  $form_data      Form data and settings.
*/

function wpf_wpforms_forms_submission_prepare_payment_meta( $payment_meta, $fields, $form_data ) {

    // Only process this snippet on the form ID 225
    if ( absint( $form_data[ 'id' ] ) !== 225 ) {
 
        return $properties;
    } 

	// Run code...

}
add_action( 'wpforms_forms_submission_prepare_payment_meta', 'wpf_wpforms_forms_submission_prepare_payment_meta', 10, 3 );