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

Il filtro wpforms_smart_tags viene utilizzato per creare, definire e registrare uno Smart Tag da utilizzare all'interno del form builder di WPForms.

Parametri

$tags
(array) (Richiesto) Chiave, Nome e registrazione dello Smart Tag.

Origine

wpforms/includes/class-smart-tags.php

Maggiori Informazioni

Il filtro viene utilizzato per creare, definire e registrare Smart Tag da utilizzare all'interno del costruttore di moduli WPForms.

L'utilizzo di questo filtro deve essere accompagnato anche da wpforms_smart_tag_process per poter elaborare lo Smart Tag.

Esempio

/**
 * Create a WPForms Smart Tag.
 * Register the Smart Tags so it will be available to select in the form builder.
 *
 * @link    https://wpforms.com/developers/wpforms_smart_tags/
 * 
 * @param   array  $tags  Key, Name and registration of Smart Tag.
 * @return  array
 */

function wpf_dev_register_smarttag( $tags ) {
 
    // Key is the tag, item is the tag name.
    $tags[ 'key' ] = 'Smart Tag Name';
     
    return $tags;
}
add_filter( 'wpforms_smart_tags', 'wpf_dev_register_smarttag', 10, 1 );

Articoli di riferimento