Atenção!

Este artigo contém código PHP e destina-se a programadores. Oferecemos este código como cortesia, mas não prestamos suporte para personalizações de código ou desenvolvimento de terceiros.

Para orientação adicional, consulte o tutorial da WPBeginner sobre como adicionar código personalizado.

Ignorar

Descrição

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.

Parâmetros

$payment_data
(array) Information about the payment, that will be saved into the database.
$fields
(array) Valores/propriedades dos campos de entrada higienizados.
$form_data
(array) Configurações/dados do formulário processados, preparados para serem usados posteriormente.

Origem

wpforms/src/Forms/Submission.php

Mais Informações

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.

Exemplos

/**
 * 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 );