- A+
所属分类:WordPress插件
Warning: Undefined variable $rr_password in /www/wwwroot/www.djsyz.com/wp-content/themes/begin/inc/down.php on line 21
Warning: Undefined variable $begin_name in /www/wwwroot/www.djsyz.com/wp-content/themes/begin/inc/down.php on line 25
Warning: Undefined variable $demo_content in /www/wwwroot/www.djsyz.com/wp-content/themes/begin/inc/down.php on line 28
首先安装插件。
* 核心插件 Contact Form 7
* 动态内容 Contact Form 7 - Dynamic Text Extension
* 提交数据存数据库 Flamingo
然后,在主题functions.php
文件添加短代码功能。
/* WordPress Shortcode Function mf_cf7_RandomStringGenerator() */
/* Required Plugin: Contact Form 7, Contact Form 7 - Dynamic Text Extension */
/* recommended Plugin: Flamingo */
/* Add this function on functions.php theme or on your plugin */
function mf_cf7_RandomStringGenerator() {
$mfstringlength = 8; // Length number generated
$mfcharacter = "012356789abcdefghijklmnopqrstuvwxyz"; // random character
for ($p = 0; $p < $mfstringlength; $p++) {
$string .= $mfcharacter[mt_rand(0,strlen($mfcharacter)-1)];
}
return $string;
}
add_shortcode('MF_CF7_RANDOMSTRINGGENERATOR', 'mf_cf7_RandomStringGenerator');
Contact Form 7表单编辑时直接引用即可。
[dynamictext ticket-id readonly "MF_CF7_RANDOMSTRINGGENERATOR"]
[dynamichidden ticket-id readonly "MF_CF7_RANDOMSTRINGGENERATOR"]
插件备份:
contact-form-7.5.1.7.zip
contact-form-7-dynamic-text-extension.2.0.3.zip
flamingo.2.1.1.zip
独角兽驿站
公众号