Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $fields = array(
- 'author' =>
- '<div class="col-md-4 comment-form-author">' .
- '<input placeholder="'.__( 'Name', '_lp' ).' '.( $req ? ' ( Required )' : '' ) .'" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) .
- '" size="30"' . $aria_req . ' /></div>',
- 'email' =>
- '<div class="col-md-4 comment-form-email">'.
- '<input placeholder="'.__( 'Email', '_lp' ).' '.( $req ? ' ( Required )' : '' ) .'" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) .
- '" size="30"' . $aria_req . ' /></div>',
- 'url' =>
- '<div class="col-md-4 comment-form-url">' .
- '<input placeholder="'.__( 'Website', '_lp' ).' '.( $req ? ' ( Required )' : '' ) .'" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
- '" size="30" /></div>',
- );
- ?>
- //for the comment wrapping functions - ensures HTML does not break.
- $comment_open_div = 0;
- /**
- * Creates an opening div for a bootstrap row.
- * @global int $comment_open_div
- */
- function _lp_before_comment_fields(){
- global $comment_open_div;
- $comment_open_div = 1;
- echo '<div class="row">';
- }
- /**
- * Creates a closing div for a bootstrap row.
- * @global int $comment_open_div
- * @return type
- */
- function _lp_after_comment_fields(){
- global $comment_open_div;
- if($comment_open_div == 0)
- return;
- echo '</div>';
- }
- add_action('comment_form_before_fields', '_lp_before_comment_fields');
- add_action('comment_form_after_fields', '_lp_after_comment_fields');
- <div class="row">
- <!--the fields and stuff-->
- </div>
- function wpse172052_comment_form_before_fields() {
- echo '<div class="row">';
- }
- add_action('comment_form_before_fields', 'wpse172052_comment_form_before_fields');
- function wpse172052_comment_form_after_fields() {
- echo '</div>';
- }
- add_action('comment_form_after_fields', 'wpse172052_comment_form_after_fields');
Add Comment
Please, Sign In to add comment