Atenção!

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

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

Dispensar

Descrição

The wpforms_smart_tags filter is used to create, define and register a Smart Tag to be used inside the WPForms form builder.

Parâmetros

$tags
(array) (Required) Key, Name and registration of Smart Tag.

Fonte

wpforms/includes/class-smart-tags.php

Mais Informações

The filter is used to create, define and register Smart Tag(s) to be used inside the WPForms form builder.

Using this filter must also be accompanied by the wpforms_smart_tag_process in order to process the Smart Tag.

Exemplo

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

Artigos de Referência