説明

について wpforms_smart_tags フィルタを使用して、WPForms フォームビルダ内で使用するスマートタグを作成、定義、登録します。

パラメータ

タグ
(配列) (必須)スマートタグのキー、名前、登録。

ソース

wpforms/includes/class-smart-tags.php

詳細情報

フィルタはWPFormsフォームビルダ内で使用するスマートタグを作成、定義、登録するために使用します。

このフィルターを使用するには wpforms_smart_tag_process スマートタグを処理するために


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

参考記事