• Hi everyone!

    I have problems with the query which check current meta-key value, and prevent before duplicate field.

    Actually i have this

    function wpufe_isbn_validation( $errors ) {
        if( $_POST['cf_isbn'] == 'xxxxxxx' ) {
            $errors[] = 'this ISBN is already in database';
        }
    
        return $errors;
    }
    add_filter( 'wpuf_add_post_validation', 'wpufe_isbn_validation' );

    All I need is query to database to get all ISBN values that already exist in database. After this my front end form called cf_isbn is compared with exist value from database, and if isbn is already in database it shows the error.

    Thanks for help!

The topic ‘prevent custom field value duplication’ is closed to new replies.