First of all add this below code to your theme’s functions.php file.
function cfp($atts, $content = null) {
extract(shortcode_atts(array( "id" => "", "title" => "", "pwd" => "" ), $atts));
if(empty($id) || empty($title)) return "";
$cf7 = do_shortcode('[contact-form-7 404 "Not Found"]');
$pwd = explode(',', $pwd);
foreach($pwd as $p) {
$p = trim($p);
$cf7 = preg_replace('/<input type="text" name="' . $p . '"/usi', '<input type="password" name="' . $p . '"', $cf7);
}
return $cf7;
}
add_shortcode('cfp', 'cfp');
Now we create a form with contact form 7 plugin with the following three fields:
usernameemail and
password
<p>Your Username (required)<br />
[text* username] </p>
<p>Your Email (required)<br />
[email* email] </p>
<p>Your Password<br />
[text* password] </p>
<p>[submit "Register"]</p>
Now if we hide password field like (***) of the contact form then write following short code into your post:
[cfp id="7" title="Test" pwd="password"]
get this error [contact-form-7 404 "Not Found"]
ReplyDeleteI'm getting the same error please help
Deletefunction cfp($atts, $content = null) {
ReplyDeleteextract(shortcode_atts(array( "id" => "", "title" => "", "pwd" => "" ), $atts));
if(empty($id) || empty($title)) return "";
$cf7 = do_shortcode('[contact-form-7 id="'. $id .'" title="' . $title . '"]');
$pwd = explode(',', $pwd);
foreach($pwd as $p) {
$p = trim($p);
$cf7 = preg_replace('/<input type="text" name="' . $p . '"/usi', '<input type="password" name="' . $p . '"', $cf7);
}
return $cf7;
}
add_shortcode('cfp', 'cfp');
does this include confirm email field?
ReplyDeleteHi,
ReplyDeletehow will you specify the number of characters. Ex: Password must be between 8-20 characters
wordpress contact email
ReplyDeleteCall Wordpress Phone Number 888-581-0004, Email, Chat Contact information. WordPress Support, Help, Errors, Migration,Hosting, WooCommerce. Call Now.
tried this but no luck.please help
ReplyDeleteHow to Make Money with Money: Tips and Tricks for Your Online
ReplyDeleteMoney: Making money 샌즈카지노 on online gambling 메리트카지노 is one of the most important tasks people all come to The reason for หาเงินออนไลน์ doing it is simple:
my password field showing the content. how to make it proper password field in contact form 7??
ReplyDelete