Achtung!

Dieser Artikel enthält PHP-Code und richtet sich an Entwickler. Wir stellen diesen Code als Service zur Verfügung, bieten jedoch keine Unterstützung für Codeanpassungen oder die Entwicklung durch Dritte.

Für zusätzliche Hilfe siehe das Tutorial von WPBeginner zum Hinzufügen von benutzerdefiniertem Code.

Schließen

Beschreibung

The wpforms_forms_submission_prepare_payment_data filter collects information about the payment and will fire when the payment is ready to be saved into the main payments table, which is used for displaying a list of payments and partially for search.

Parameter

$payment_data
(array) Information about the payment, that will be saved into the database.
$fields
(array) Bereinigte Feldwerte/Eigenschaften des Eintrags.
$form_data
(array) Verarbeitete Formulareinstellungen/Daten, die zur späteren Verwendung vorbereitet sind.

Quelle

wpforms/src/Forms/Submission.php

Weitere Informationen

The filter collects information about the payment and will fire when the payment is ready to be saved into the main payments table, which is used for displaying a list of payments and partially for search.

Beispiele

/**
 * Used to gather information about the payment before being saved to the main payments table.
 *
 * @link  https://wpforms.com/developers/wpforms_forms_submission_prepare_payment_data/
 *
 * @param array  $payment_data   Information about the payment, that will be saved into the database.
 * @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_data, $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_data', 'wpf_wpforms_forms_submission_prepare_payment_meta', 10, 3 );