public static function addCustomFields($tag)
    {
        $tag = new FormTag($tag);

        if (empty($tag->getType())) {
            return '';
        }

        $validation_error = wpcf7_get_validation_error($tag->getName());
        $class = self::getClass($tag, $validation_error);

        $atts = self::getAtts($tag, $validation_error, $class);

        $html = sprintf(
            '<input class="%1$s" %2$s />%3$s',
            sanitize_html_class($tag->getName()),
            $atts,
            $validation_error
        );

        return $html;
    }