Description

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

Parameters

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

Source

wpforms/includes/class-smart-tags.php

More Information

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.

Example


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

Reference Articles