Make WordPress Core

Changeset 34871


Ignore:
Timestamp:
10/06/2015 05:16:09 PM (9 years ago)
Author:
DrewAPicture
Message:

Template: Introduce a new class_form argument in comment_form(), allowing customization of the form class attribute.

The static 'comment-form' class was originally added to comment_form() in [24525]. This new argument should provide needed flexibility in styling the comment form further.

Props flixos90.
Fixes #34170. See #23851.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r34792 r34871  
    20032003 * @since 3.0.0
    20042004 * @since 4.1.0 Introduced the 'class_submit' argument.
    2005  * @since 4.2.0 Introduced 'submit_button' and 'submit_fields' arguments.
    2006  * @since 4.4.0 Introduced 'title_reply_before', 'title_reply_after',
     2005 * @since 4.2.0 Introduced the 'submit_button' and 'submit_fields' arguments.
     2006 * @since 4.4.0 Introduced the 'class_form', 'title_reply_before', 'title_reply_after',
    20072007 *              'cancel_reply_before', and 'cancel_reply_after' arguments.
    20082008 *
     
    20252025 *     @type string $id_form              The comment form element id attribute. Default 'commentform'.
    20262026 *     @type string $id_submit            The comment submit element id attribute. Default 'submit'.
     2027 *     @type string $class_form           The comment form element class attribute. Default 'comment-form'.
    20272028 *     @type string $class_submit         The comment submit element class attribute. Default 'submit'.
    20282029 *     @type string $name_submit          The comment submit element name attribute. Default 'submit'.
     
    20932094        'id_form'              => 'commentform',
    20942095        'id_submit'            => 'submit',
     2096        'class_form'           => 'comment-form',
    20952097        'class_submit'         => 'submit',
    20962098        'name_submit'          => 'submit',
     
    21542156                do_action( 'comment_form_must_log_in_after' );
    21552157            else : ?>
    2156                 <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="comment-form"<?php echo $html5 ? ' novalidate' : ''; ?>>
     2158                <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="<?php echo esc_attr( $args['class_form'] ); ?>"<?php echo $html5 ? ' novalidate' : ''; ?>>
    21572159                    <?php
    21582160                    /**
Note: See TracChangeset for help on using the changeset viewer.