Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function comment_form( $args = array(), $post_id = null ) {
- global $id;
- if ( null === $post_id )
- $post_id = $id;
- else
- $id = $post_id;
- $commenter = wp_get_current_commenter();
- $user = wp_get_current_user();
- $user_identity = $user->exists() ? $user->display_name : '';
- $req = get_option( 'require_name_email' );
- $aria_req = ( $req ? " aria-required='true'" : '' );
- $fields = array(
- 'author' => '<p class="comment-form-author">' . '<label for="author">' . __( '' ) . '</label> ' . ( $req ? '<span class="required"></span>' : '' ) .
- '<input id="author" name="author" placeholder="Имя*" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
- 'email' => '<p class="comment-form-email"><label for="email">' . __( '' ) . '</label> ' . ( $req ? '<span class="required"></span>' : '' ) .
- '<input id="email" name="email" placeholder="Email*" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
- 'url' => '<p class="comment-form-url"><label for="url">' . __( '' ) . '</label>' .
- '<input id="url" name="url" placeholder="Website" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
- 'age' => '<p class="comment-form-age"><label for="age">' . __( '' ) . '</label>' . ( $req ? '<span class="required"></span>' : '' ) .
- '<input id="age" name="age" placeholder="Возраст*" type="text" value="' . esc_attr( $commenter['comment_author_age'] ) . '" size="30" /></p>',
- );
- $required_text = sprintf( ' ' . __(' '), '<span class="required">*</span>' );
- $defaults = array(
- 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
- 'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" placeholder="Ваш комментарий..."></textarea></p>',
- 'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
- 'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
- 'comment_notes_before' => '<p class="comment-notes">' . __( '' ) . ( $req ? $required_text : '' ) . '</p>',
- 'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>',
- 'id_form' => '',
- 'id_submit' => 'submit',
- 'title_reply' => __( 'Leave a Reply' ),
- 'title_reply_to' => __( 'Leave a Reply to %s' ),
- 'cancel_reply_link' => __( 'Cancel reply' ),
- 'label_submit' => __( 'Post Comment' ),
- );
- $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
Add Comment
Please, Sign In to add comment