评论表单名称和电子邮件不起作用?

时间:2020-09-29 作者:social

我正试图使用评论表单发表评论,但上面写着:

错误:请填写必填字段(姓名、电子邮件)。

请问我该怎么办?这是我的代码:

\'author\' =>
                \'<div class="row padding-xs-top">
                <div class="col-md-4 col-sm-4">
                    <div class="form-group ct-form-group-label--float"><label for="contact_name">\' . \'</label> <span class="required"></span><input id="contact_name" name="field[]" class="form-control input-lg" type="text" value="Name *"\' . esc_attr( $commenter[\'comment_author\'] ) . \'" required="required" /></div></div>\',
                
            \'email\' =>
                \'<div class="col-md-4 col-sm-4">
                <div class="form-group ct-form-group-label--float"><label for="contact_email">\' . \'</label> <span class="required"></span><input id="contact_email" name="field[]" class="form-control input-lg" type="email" value="Email *"\' . esc_attr(  $commenter[\'comment_author_email\'] ) . \'" required="required" /></div></div>\'

1 个回复
最合适的回答,由SO网友:Valerii Vasyliev 整理而成

字段名称不正确

\'author\' =>
                \'<div class="row padding-xs-top">
                <div class="col-md-4 col-sm-4">
                    <div class="form-group ct-form-group-label--float"><label for="contact_name">\' . \'</label> <span class="required"></span><input id="contact_name" name="author" class="form-control input-lg" type="text" value="Name *"\' . esc_attr( $commenter[\'comment_author\'] ) . \'" required="required" /></div></div>\',
                
            \'email\' =>
                \'<div class="col-md-4 col-sm-4">
                <div class="form-group ct-form-group-label--float"><label for="contact_email">\' . \'</label> <span class="required"></span><input id="contact_email" name="email" class="form-control input-lg" type="email" value="Email *"\' . esc_attr(  $commenter[\'comment_author_email\'] ) . \'" required="required" /></div></div>\'

相关推荐

在第三方API响应后发送Gravit Forms通知

我有一个重力表单,在提交时将数据发送给第三方API。它与以下代码连接并通过API保存数据。然而,我现在正试图弄清楚,只有当API响应返回为失败或状态代码201以外的任何内容时,才如何发送管理员通知电子邮件。add_action( \'gform_after_submission_1\', \'post_to_third_party\', 10, 2 ); function post_to_third_party( $entry, $form ) { $post_url =