php - WordPress comment submit button substitutesoptions

$args = array('id_form' => 'commentform','class_form'=> 'comm

$args = array(
                'id_form'           => 'commentform',
                'class_form'        => 'comment-form theme-comment-action',
                'id_submit'         => 'submit',
                'class_submit'      => 'submit',
                'name_submit'       => 'submit',
                'submit_button'     => '<a name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s"><i class="fa fa-comment" aria-hidden="true"></i><span> Submit Comment </span></a>',
                'title_reply'       => '',
                'title_reply_to'    => __( 'Reply to %s','text-domain' ),
                'cancel_reply_link' => __( 'Cancel comment','text-domain' ),
                'label_submit'      => __( 'Post comment','text-domain' ),
                'format'            => 'xhtml',
                'comment_field'     =>  '<textarea id="comment" name="comment" placeholder="'.__('Enter Your Comment Here','text-domain').'" cols="45" rows="8" aria-required="true">' .'</textarea>',
                'logged_in_as'      => '<p class="logged-in-as">' .
                                      sprintf(
                                          __( 'Logged in as %1$s. <a href="%2$s" title="%3$s">%4$s</a>', 'text-domain'),
                                          $user_identity,
                                          wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ),
                                          __('Log out?','text-domain'),
                                          __('Click to log out.','text-domain')
                                      ) . '</p>',
                'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.','text-domain' ) .'</p>',
                'fields'            => apply_filters( 'comment_form_default_fields', $fields ),
            );

            comment_form( $args );

Above is the method how we make changes to some of the fields in the comment system.

One such field is submit Button →

'submit_button'     => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',

But my HTML is designed in such a way that this uses an <a></a> tag. Itried to use something like this:

<a name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s"><i class="fa fa-comment" aria-hidden="true"></i><span> Submit Comment </span></a>

But it is doesn't work. Can someone recommend any fix?

$args = array(
                'id_form'           => 'commentform',
                'class_form'        => 'comment-form theme-comment-action',
                'id_submit'         => 'submit',
                'class_submit'      => 'submit',
                'name_submit'       => 'submit',
                'submit_button'     => '<a name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s"><i class="fa fa-comment" aria-hidden="true"></i><span> Submit Comment </span></a>',
                'title_reply'       => '',
                'title_reply_to'    => __( 'Reply to %s','text-domain' ),
                'cancel_reply_link' => __( 'Cancel comment','text-domain' ),
                'label_submit'      => __( 'Post comment','text-domain' ),
                'format'            => 'xhtml',
                'comment_field'     =>  '<textarea id="comment" name="comment" placeholder="'.__('Enter Your Comment Here','text-domain').'" cols="45" rows="8" aria-required="true">' .'</textarea>',
                'logged_in_as'      => '<p class="logged-in-as">' .
                                      sprintf(
                                          __( 'Logged in as %1$s. <a href="%2$s" title="%3$s">%4$s</a>', 'text-domain'),
                                          $user_identity,
                                          wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ),
                                          __('Log out?','text-domain'),
                                          __('Click to log out.','text-domain')
                                      ) . '</p>',
                'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.','text-domain' ) .'</p>',
                'fields'            => apply_filters( 'comment_form_default_fields', $fields ),
            );

            comment_form( $args );

Above is the method how we make changes to some of the fields in the comment system.

One such field is submit Button →

'submit_button'     => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />',

But my HTML is designed in such a way that this uses an <a></a> tag. Itried to use something like this:

<a name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s"><i class="fa fa-comment" aria-hidden="true"></i><span> Submit Comment </span></a>

But it is doesn't work. Can someone recommend any fix?

Share Improve this question asked Sep 11, 2017 at 9:54 WordCentWordCent 1,9066 gold badges34 silver badges60 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

The <a> tag is the wrong tag for a submit button. <input type="submit"> and <button> are designed for this purpose. An <a> tag won't even submit the form data. You need to change your HTML to accommodate this fact.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745596706a4635159.html

相关推荐

  • php - WordPress comment submit button substitutesoptions

    $args = array('id_form' => 'commentform','class_form'=> 'comm

    15小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信