Thank you.
Yes, everything works fine because I deleted the code.
your team told me to include this in fuctions.php
add_filter('cred_form_validate','func_validate_usuario_denuncia',10,2);
function func_validate_usuario_denuncia($error_fields, $form_data){
//field data are field values and errors
list($fields,$errors)=$error_fields;
if ($form_data['id']==36925){
$args = array(
'meta_query' => array(
array('key' => 'wpcf-usuario-denuncia',
'value' => $_POST['wpcf-usuario-denuncia']
)),
'post_type' => 'denuncia',
'posts_per_page' => -1
);
$posts = get_posts($args);
//check if birthday value is already on the database
if (count($posts) > 0){
//set error message for my_field
$errors['wpcf-usuario-denuncia']='Usuario ya existente, por favor utilice un nuevo usuario, gracias';
}
}
return array($fields,$errors);
}
I guess in the next direction
public_html/pullmantur/wp-content/themes/dt-the7
and adding it to the current one
This is the result of put it together:
<?php
/**
* Vogue theme.
*
* @since 1.0.0
*/
// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }
/**
* Set the content width based on the theme's design and stylesheet.
*
* @since 1.0.0
*/
if ( ! isset( $content_width ) ) {
$content_width = 1200; /* pixels */
}
/**
* Initialize theme.
*
* @since 1.0.0
*/
require( trailingslashit( get_template_directory() ) . 'inc/init.php' );
//* Excluye páginas específicas de los resultados de búsqueda en WordPress. Las estáticas y las del formulario de denuncia de las empresas
function filtro_paginas_especificas( $query ) {
if ( $query->is_search && $query->is_main_query() ) {
$query->set( 'post__not_in', array( 35563,35532,35542,35534,35536,35538,35544,35540,35939 ) );
}
}
add_filter( 'pre_get_posts', 'filtro_paginas_especificas' );
add_filter('cred_form_validate','func_validate_usuario_denuncia',10,2);
function func_validate_usuario_denuncia($error_fields, $form_data){
//field data are field values and errors
list($fields,$errors)=$error_fields;
if ($form_data['id']==36925){
$args = array(
'meta_query' => array(
array('key' => 'wpcf-usuario-denuncia',
'value' => $_POST['wpcf-usuario-denuncia']
)),
'post_type' => 'denuncia',
'posts_per_page' => -1
);
$posts = get_posts($args);
//check if birthday value is already on the database
if (count($posts) > 0){
//set error message for my_field
$errors['wpcf-usuario-denuncia']='Usuario ya existente, por favor utilice un nuevo usuario, gracias';
}
}
return array($fields,$errors);
}
and everything started worked badly
sure I did not know how to do well
I will stand by