Custom post type "Password" for Contact form 7 (WORDPRESS)
$10-30 USD
Terminado
Publicado hace casi 11 años
$10-30 USD
Pagado a la entrega
Hello,
I would like to add custom post type loop to the functions.php. I've created PHP function to validate contact form (contact form 7). My function is simple, but it doesn't solve my problem.
My custom post type is created to define TITLE of password, so 1 post = 1 password.
I would like to load my loop into my function but impossible for me.
This is my code:
function custom_email_validation_filter($result,$tag){
$type = $tag['type'];
$name = $tag['name'];
if($name == 'your-id'){ // Only apply to fields with the form field name of "company-email"
$the_value = $_POST[$name];
if(( $the_value != 'test' ) && ( $the_value != 'test2' )) {
$result['valid'] = false;
$result['reason'][$name] = "Votre identifiant n'est pas correct";
}
}
return $result;
}
add_filter('wpcf7_validate_text','custom_email_validation_filter', 10, 2);
add_filter('wpcf7_validate_text*', 'custom_email_validation_filter', 10, 2);
So "test" and "test2" are PASSWORD, but I would like to connect my custom post type named "PASSWORD" to change this password.
Hello, I am experienced over 3 years in PHP-MySQL-Ajax-Javascript based web applications and is confident working with you. Please view PMB with more details Thanks