WordPress.org

Make WordPress Core

Changeset 48393


Ignore:
Timestamp:
07/07/2020 06:27:03 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Comments: Allow passing a custom class to the form container element in comment_form().

Props cjbj, yahil, mayankmajeji, andraganescu, SergeyBiryukov.
Fixes #41009.

File:
1 edited

Legend:

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

    r48140 r48393  
    22382238 * @since 4.6.0 Introduced the 'action' argument.
    22392239 * @since 4.9.6 Introduced the 'cookies' default comment field.
     2240 * @since 5.5.0 Introduced the 'class_container' argument.
    22402241 *
    22412242 * @param array       $args {
     
    22602261 *     @type string $id_form              The comment form element id attribute. Default 'commentform'.
    22612262 *     @type string $id_submit            The comment submit element id attribute. Default 'submit'.
     2263 *     @type string $class_container      The comment form container class attribute. Default 'comment-respond'.
    22622264 *     @type string $class_form           The comment form element class attribute. Default 'comment-form'.
    22632265 *     @type string $class_submit         The comment submit element class attribute. Default 'submit'.
     
    24352437        'id_form'              => 'commentform',
    24362438        'id_submit'            => 'submit',
     2439        'class_container'      => 'comment-respond',
    24372440        'class_form'           => 'comment-form',
    24382441        'class_submit'         => 'submit',
     
    24822485    do_action( 'comment_form_before' );
    24832486    ?>
    2484     <div id="respond" class="comment-respond">
     2487    <div id="respond" class="<?php echo esc_attr( $args['class_container'] ); ?>">
    24852488        <?php
    24862489        echo $args['title_reply_before'];
Note: See TracChangeset for help on using the changeset viewer.