<html lang="it-it" dir="ltr"><head></head><body>### [wpforms_form_token_check_after_today](https://wpforms.com/developers/wpforms_form_token_check_after_today/)

**Pubblicato:** 21 maggio 2021
**Autore:** Team Editoriale

**Estratto:** Il filtro wpforms_form_token_check_after_today viene utilizzato per estendere i tempi di cache utilizzati per il token del modulo.

**Contenuto:**

## Descrizione

Il filtro `wpforms_form_token_check_after_today` viene utilizzato per estendere i tempi di cache utilizzati per il token del modulo.

## Parametri

$times*(array)* Un array di tempi da controllare dopo oggi.## Sorgente

`wpforms/src/Forms/Token.php`

## Ulteriori Informazioni

Il filtro `wpforms_form_token_check_after_today` può essere utilizzato per estendere i tempi di cache che WPForms utilizza sui token del modulo per i tempi successivi.

Questo filtro viene utilizzato principalmente per gestire casi limite come il caricamento e l'invio della pagina del modulo in due giorni diversi.

È disponibile anche un altro filtro per estendere i tempi di cache anche prima. Si prega di consultare il filtro [`wpforms_form_token_check_before_today`](https://wpforms.com/developers/wpforms_form_token_check_before_today/ "Utilizzo del filtro wpforms_form_token_check_before_today").

## Esempio

```php

/**
 * Estende il tempo di cache sui token del modulo prima di oggi.
 *
 * @param array $times Un array di tempi da controllare prima di oggi.
 * @return array
 */
function example_add_longer_token_time_before( $times ) {
    // Consente al token di persistere per 3, 4 e 5 giorni
    $times[] = 3 * DAY_IN_SECONDS;
    $times[] = 4 * DAY_IN_SECONDS;
    $times[] = 5 * DAY_IN_SECONDS;

    return $times;
}
add_filter( 'wpforms_form_token_check_before_today', 'example_add_longer_token_time_before' );

/**
 * Estende il tempo di cache sui token del modulo dopo oggi.
 *
 * Questo filtro serve a gestire casi limite in cui qualcuno carica il modulo e lo invia,
 * con la scadenza che avviene nel frattempo. Renderlo più lungo consente maggiore flessibilità.
 *
 * @param array $times Un array di tempi da controllare dopo oggi.
 * @return array
 */
function example_add_longer_token_time_after( $times ) {
    // Consente al token di persistere per 1 giorno
    $times[] = DAY_IN_SECONDS;

    return $times;
}
add_filter( 'wpforms_form_token_check_after_today', 'example_add_longer_token_time_after' );
```

## Correlati

Riferimento articolo: [Come modificare il tempo di cache del token del tuo modulo](https://wpforms.com/developers/how-to-change-the-cache-time-on-your-form-token/ "Come modificare il tempo di cache del token del tuo modulo")

Riferimento filtro aggiuntivo: [wpforms\_form\_token\_check\_before\_today](https://wpforms.com/developers/wpforms_form_token_check_before_today/ "Utilizzo del filtro wpforms_form_token_check_before_today filter")

**Categorie:** Filtri Hook

**Tag:** PHP

---</body></html>