function beforeSave($options = array()) { $this->data['Answer']['answer'] = strip_tags($this->data['Answer']['answer'], allowed_tags('strip_tags')); $this->data['Answer']['response_heading'] = strip_tags($this->data['Answer']['response_heading'], allowed_tags('strip_tags')); $this->data['Answer']['response'] = strip_tags($this->data['Answer']['response'], allowed_tags('strip_tags')); return true; }
function progo_bootstrap3_comment_form($args) { $args['comment_field'] = '<div class="form-group comment-form-comment"><label for="comment">' . __('Comment', 'pgb') . '</label> <textarea class="form-control" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></div>'; $args['comment_notes_after'] = '<p class="form-allowed-tags">' . __('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:') . '</p><div class="alert alert-info">' . allowed_tags() . '</div>'; $args['id_form'] = 'commentform'; $args['id_submit'] = 'commentsubmit'; $args['title_reply'] = __('Leave a Reply', 'pgb'); $args['title_reply_to'] = __('Leave a Reply to %s', 'pgb'); $args['cancel_reply_link'] = __('Cancel Reply', 'pgb'); $args['label_submit'] = __('Post Comment', 'pgb'); return $args; }
function j_comment_default_form($defaults) { global $id; $post_id = $id; $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; $req = get_option('require_name_email'); $required_text = sprintf(' ' . __('Required fields are marked %s', 'jeg_textdomain'), '<span class="required">*</span>'); $newdefaults = array('fields' => $defaults['fields'], 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __('Comment', 'jeg_textdomain') . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'jeg_textdomain'), 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>', 'jeg_textdomain'), 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">' . __('Your email address will not be published', 'jeg_textdomain') . ($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', 'jeg_textdomain'), ' <code>' . allowed_tags() . '</code>') . '</p>', 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __('Leave a Reply', 'jeg_textdomain'), 'title_reply_to' => __('Leave a Reply to %s', 'jeg_textdomain'), 'cancel_reply_link' => __('Cancel reply', 'jeg_textdomain'), 'label_submit' => __('Post Comment', 'jeg_textdomain')); return $newdefaults; }
function extend_kses_plus_comment_settings() { $allow_kses = get_option('allow_kses', extend_kses_plus_default()); $allow_kses_div_selected = isset($allow_kses['div']) ? 'checked' : ''; $allow_kses_img_selected = isset($allow_kses['img']) ? 'checked' : ''; $allow_kses_map_selected = isset($allow_kses['map']) ? 'checked' : ''; $allow_kses_pre_selected = isset($allow_kses['pre']) ? 'checked' : ''; $title = translate('Comments'); $allow_kses_div_label = __('Allow <code>div</code> tag', 'extend-kses'); $allow_kses_img_label = __('Allow <code>img</code> tag', 'extend-kses'); $allow_kses_pre_label = __('Allow <code>pre</code> tag', 'extend-kses'); $allow_kses_map_label = __('Allow <code>map</code> and <code>area</code> tags', 'extend-kses'); print "\n <fieldset>\n <legend class='screen-reader-text'><span>{$title}</span></legend>\n\t\t\t<label><input type='checkbox' name='allow_kses[div]' value='yes' {$allow_kses_div_selected} /> {$allow_kses_div_label}</label><br>\n\t\t\t<label><input type='checkbox' name='allow_kses[img]' value='yes' {$allow_kses_img_selected} /> {$allow_kses_img_label}</label><br>\n\t\t\t<label><input type='checkbox' name='allow_kses[pre]' value='yes' {$allow_kses_pre_selected} /> {$allow_kses_pre_label}</label><br>\n\t\t\t<label><input type='checkbox' name='allow_kses[map]' value='yes' {$allow_kses_map_selected} /> {$allow_kses_map_label}</label>\n\t\t</fieldset>\n\t"; if (defined('WP_DEBUG') && true == WP_DEBUG) { $allowed_tags = wp_kses_allowed_html('post'); echo "<div style='height:200px;overflow:scroll'><pre>"; var_dump($allowed_tags); echo "</pre></div><code>"; echo allowed_tags(); echo "</code>"; } }
/** * Filter the comment form. * Remove comment form allowed tags if theme option is de-activated. * * @param $defaults * @return mixed */ function ultra_comment_form_defaults($defaults) { if (siteorigin_setting('comments_allowed_tags')) { $defaults['comment_notes_after'] = '<p class="form-allowed-tags">' . sprintf(__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', 'ultra'), ' <code>' . allowed_tags() . '</code>') . '</p>'; } return $defaults; }
// if comments pages > 1 and comments pagination enabled $args = array('prev_text' => '«', 'next_text' => '»'); paginate_comments_links($args); // show comments pagination } // if comments pages > 1 and comments pagination enabled - end } // if comments exists - end if (comments_open()) { // if comments open /* COMMENT FORM STAFF */ $fields = array('author' => '<label for="author"> Your name <input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" required></label>', 'email' => '<label for="email"> Your email <input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" required></label>', 'url' => '<label for="url"> Your site <input id="url" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30"></label>'); $args = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => '<label for="comment">Say something <textarea id="comment" name="comment" cols="45" rows="8"></textarea></label>', 'must_log_in' => '<p class="must-log-in">You must be login! ' . wp_login_url(apply_filters('the_permalink', get_permalink())) . '</p>', 'logged_in_as' => '<p class="logged-in-as">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s">Выйти?</a>'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p>', 'comment_notes_before' => '<p class="comment-notes">Your email address will not be published.</p>', 'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf(__('You may use these <abbr>HTML</abbr> tags and attributes: %s'), '<code>' . allowed_tags() . '</code>') . '</p>', 'id_form' => 'commentform', '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'); /* NEXT CODE WILL BE REPLACE NATIVE COMMENT FORM MARKUP, THAT WE CANNOT CHANGE WITH STANDART FUNCTIONS */ /* FOR EXAMPLE IT MAY BE HELPFUL IF WE NEED TO CHANGE MARKUP FOR TWITTER BOOTSTRAP */ ob_start(); // enable output buferisation comment_form($args); // show comment form with ours arguments $what_changes = array('<small>' => '', '</small>' => '', '<h3 id="reply-title" class="comment-reply-title">' => '<span id="reply-title">', '</h3>' => '</span>', '<input name="submit" type="submit" id="submit" value="' . $args['label_submit'] . '" />' => '<button type="submit">' . $args['label_submit'] . '</ button>'); $new_form = str_replace(array_keys($what_changes), array_values($what_changes), ob_get_contents()); // меняем элементы в форме ob_end_clean(); // clear buferiation echo $new_form; // show new form } ?>
/** * Function Name: origines_comment_form * Description: Custom comment form for bootstrap. */ function origines_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' => '<label for="author">' . __('Name') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' />', 'email' => '<label for="email">' . __('Email') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' />', 'url' => '<label for="url">' . __('Website') . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" />'); $required_text = sprintf(' ' . __('Required fields are marked %s'), '<span class="required">*</span>'); $defaults = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => '<label for="comment">' . _x('Comment', 'noun') . '</label><textarea id="comment" name="comment" cols="45" rows="4" aria-required="true" class="span9"></textarea>', 'must_log_in' => '<span class="help-block 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)))) . '</span>', 'logged_in_as' => '<span class="help-block 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>'), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</span>', 'comment_notes_before' => '<span class="help-block comment-notes">' . __('Your email address will not be published.') . ($req ? $required_text : '') . '</span>', 'comment_notes_after' => '<span class="help-block form-allowed-tags">' . sprintf(__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s'), ' <code>' . allowed_tags() . '</code>') . '</span>', 'id_form' => 'commentform', '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)); ?> <?php if (comments_open($post_id)) { ?> <?php do_action('comment_form_before'); ?> <div id="respond" class="row"> <form action="<?php echo site_url('/wp-comments-post.php'); ?> " method="post" id="<?php echo esc_attr($args['id_form']); ?> "> <fieldset class="span9"> <legend><?php comment_form_title($args['title_reply'], $args['title_reply_to']); ?> <small><?php cancel_comment_reply_link($args['cancel_reply_link']); ?> </small></legend> <?php if (get_option('comment_registration') && !is_user_logged_in()) { ?> <?php echo $args['must_log_in']; ?> <?php do_action('comment_form_must_log_in_after'); ?> <?php } else { ?> <?php do_action('comment_form_top'); ?> <?php if (is_user_logged_in()) { ?> <?php echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity); ?> <?php do_action('comment_form_logged_in_after', $commenter, $user_identity); ?> <?php } else { ?> <?php echo $args['comment_notes_before']; ?> <?php do_action('comment_form_before_fields'); foreach ((array) $args['fields'] as $name => $field) { echo apply_filters("comment_form_field_{$name}", $field) . "\n"; } do_action('comment_form_after_fields'); ?> <?php } ?> <?php echo apply_filters('comment_form_field_comment', $args['comment_field']); ?> <?php /* echo $args['comment_notes_after']; */ ?> <div class="form-actions"> <button type="submit" class="btn btn-primary" id="<?php echo esc_attr($args['id_submit']); ?> "><?php echo esc_attr($args['label_submit']); ?> </button> <?php comment_id_fields($post_id); ?> </div> <?php do_action('comment_form', $post_id); ?> <?php } ?> </fieldset> </form> </div> <!-- #respond --> <?php do_action('comment_form_after'); ?> <?php } else { ?> <?php do_action('comment_form_comments_closed'); ?> <?php } ?> <?php }
/** * returns the formatted form of the comments * * @param array $args an array of arguments to be filtered * @param int $post_id if form is called within the loop then post_id is optional * * @return string Return the comment form */ function sh_comment_form($args = array(), $post_id = null, $review = false) { if (null === $post_id) { $post_id = get_the_ID(); } else { $id = $post_id; } $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; $args = wp_parse_args($args); if (!isset($args['format'])) { $args['format'] = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml'; } $req = get_option('require_name_email'); $aria_req = $req ? " aria-required='true'" : ''; $html5 = 'html5' === $args['format']; $fields = array('author' => '<div class="col-md-6"><div class="form-group"><input id="author" placeholder="' . esc_html__('Name', SH_NAME) . '" class="form-control" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></div></div>', 'email' => '<div class="col-md-6"><div class="form-group"><input id="email" placeholder="' . esc_html__('Email', SH_NAME) . '" class="form-control" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></div></div>'); $required_text = sprintf(' ' . esc_html__('Required fields are marked %s', SH_NAME), '<span class="required">*</span>'); /** * Filter the default comment form fields. * * @since 3.0.0 * * @param array $fields The default comment fields. */ $fields = apply_filters('comment_form_default_fields', $fields); $defaults = array('fields' => $fields, 'comment_field' => '<div class="col-md-12"><div class="form-group"><textarea id="comment" placeholder="' . esc_html__('Comment', SH_NAME) . '" class="form-control" name="comment" cols="45" rows="8" aria-required="true"></textarea></div></div>', 'must_log_in' => '<p class="col-md-12 col-sm-12">' . sprintf(esc_html__('You must be <a href="%s">logged in</a> to post a comment.', SH_NAME), wp_login_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'logged_in_as' => '<p class="col-md-12 col-sm-12">' . sprintf(esc_html__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', SH_NAME), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'comment_notes_before' => '<p class="col-md-12 col-sm-12">' . esc_html__('Your email address will not be published.', SH_NAME) . ($req ? $required_text : '') . '</p>', 'comment_notes_after' => '<p class="col-md-12 col-sm-12">' . sprintf(esc_html__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', SH_NAME), ' <code>' . allowed_tags() . '</code>') . '</p>', 'id_form' => 'comments_form', 'id_submit' => 'submit', 'title_reply' => esc_html__('Leave a Reply', SH_NAME), 'title_reply_to' => esc_html__('Leave a Reply to %s', SH_NAME), 'cancel_reply_link' => esc_html__('Cancel reply', SH_NAME), 'label_submit' => esc_html__('Send', SH_NAME), 'format' => 'xhtml'); /** * Filter the comment form default arguments. * * Use 'comment_form_default_fields' to filter the comment fields. * * @since 3.0.0 * * @param array $defaults The default comment form arguments. */ $args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults)); ?> <?php if (comments_open($post_id)) { ?> <?php /** * Fires before the comment form. * * @since 3.0.0 */ do_action('comment_form_before'); ?> <div id="respond" class="comment-respond"> <div class="post-header"> <div class="uppercase no-margin h2"><?php comment_form_title($args['title_reply'], $args['title_reply_to']); ?> <small><?php cancel_comment_reply_link($args['cancel_reply_link']); ?> </small></div> </div> <?php if (get_option('comment_registration') && !is_user_logged_in()) { ?> <?php echo blanaceTags($args['must_log_in']); ?> <?php /** * Fires after the HTML-formatted 'must log in after' message in the comment form. * * @since 3.0.0 */ do_action('comment_form_must_log_in_after'); ?> <?php } else { ?> <form action="<?php echo site_url('/wp-comments-post.php'); ?> " method="post" id="<?php echo esc_attr($args['id_form']); ?> " class="row"<?php echo esc_attr($html5) ? ' novalidate' : ''; ?> > <?php /** * Fires at the top of the comment form, inside the <form> tag. * * @since 3.0.0 */ do_action('comment_form_top'); ?> <?php if (is_user_logged_in()) { ?> <?php /** * Filter the 'logged in' message for the comment form for display. * * @since 3.0.0 * * @param string $args['logged_in_as'] The logged-in-as HTML-formatted message. * @param array $commenter An array containing the comment author's username, email, and URL. * @param string $user_identity If the commenter is a registered user, the display name, blank otherwise. */ echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity); ?> <?php /** * Fires after the is_user_logged_in() check in the comment form. * * @since 3.0.0 * * @param array $commenter An array containing the comment author's username, email, and URL. * @param string $user_identity If the commenter is a registered user, the display name, blank otherwise. */ do_action('comment_form_logged_in_after', $commenter, $user_identity); ?> <?php } else { ?> <?php echo balanceTags($args['comment_notes_before']); ?> <?php /** * Fires before the comment fields in the comment form. * * @since 3.0.0 */ do_action('comment_form_before_fields'); foreach ((array) $args['fields'] as $name => $field) { /** * Filter a comment form field for display. * * The dynamic portion of the filter hook, $name, refers to the name * of the comment form field. Such as 'author', 'email', or 'url'. * * @since 3.0.0 * * @param string $field The HTML-formatted output of the comment form field. */ echo apply_filters("comment_form_field_{$name}", $field) . "\n"; } /** * Fires after the comment fields in the comment form. * * @since 3.0.0 */ do_action('comment_form_after_fields'); ?> <?php } ?> <?php /** * Filter the content of the comment textarea field for display. * * @since 3.0.0 * * @param string $args['comment_field'] The content of the comment textarea field. */ echo apply_filters('comment_form_field_comment', $args['comment_field']); ?> <div class="clearfix"></div> <?php echo balanceTags($args['comment_notes_after']); ?> <div class="col-md-12"> <input name="submit" type="submit" class="btn btn-primary pull-left" id="<?php echo esc_attr($args['id_submit']); ?> " value="<?php echo esc_attr($args['label_submit']); ?> " /> <?php comment_id_fields($post_id); ?> </div> <?php /** * Fires at the bottom of the comment form, inside the closing </form> tag. * * @since 1.5.2 * * @param int $post_id The post ID. */ do_action('comment_form', $post_id); ?> </form> <?php } ?> </div><!-- #respond --> <?php /** * Fires after the comment form. * * @since 3.0.0 */ do_action('comment_form_after'); } else { /** * Fires after the comment form if comments are closed. * * @since 3.0.0 */ do_action('comment_form_comments_closed'); } }
/** * Comment form */ function zee_comment_form($args = array(), $post_id = null) { if (null === $post_id) { $post_id = get_the_ID(); } else { $id = $post_id; } $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; if (!isset($args['format'])) { $args['format'] = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml'; } $req = get_option('require_name_email'); $aria_req = $req ? " aria-required='true'" : ''; $html5 = 'html5' === $args['format']; $fields = array('author' => ' <div class="form-group"> <div class="col-sm-6 comment-form-author"> <input class="form-control" id="author" placeholder="' . __('Name', ZEETEXTDOMAIN) . '" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" ' . $aria_req . ' /> </div>', 'email' => '<div class="col-sm-6 comment-form-email"> <input id="email" class="form-control" name="email" placeholder="' . __('Email', ZEETEXTDOMAIN) . '" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" ' . $aria_req . ' /> </div> </div>', 'url' => '<div class="form-group"> <div class=" col-sm-12 comment-form-url">' . '<input class="form-control" placeholder="' . __('Website', ZEETEXTDOMAIN) . '" id="url" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '" /> </div></div>'); $required_text = sprintf(' ' . __('Required fields are marked %s', ZEETEXTDOMAIN), '<span class="required">*</span>'); $defaults = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => ' <div class="form-group comment-form-comment"> <div class="col-sm-12"> <textarea class="form-control" id="comment" name="comment" placeholder="' . _x('Comment', 'noun', ZEETEXTDOMAIN) . '" rows="8" aria-required="true"></textarea> </div> </div> ', 'must_log_in' => ' <div class="alert alert-danger 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)))) . '</div>', 'logged_in_as' => '<div class="alert alert-info 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>', ZEETEXTDOMAIN), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</div>', 'comment_notes_before' => '<div class="alert alert-info comment-notes">' . __('Your email address will not be published.', ZEETEXTDOMAIN) . ($req ? $required_text : '') . '</div>', 'comment_notes_after' => '<div class="form-allowed-tags">' . sprintf(__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', ZEETEXTDOMAIN), ' <code>' . allowed_tags() . '</code>') . '</div>', 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __('Leave a Reply', ZEETEXTDOMAIN), 'title_reply_to' => __('Leave a Reply to %s', ZEETEXTDOMAIN), 'cancel_reply_link' => __('Cancel reply', ZEETEXTDOMAIN), 'label_submit' => __('Post Comment', ZEETEXTDOMAIN), 'format' => 'xhtml'); $args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults)); if (comments_open($post_id)) { ?> <?php do_action('comment_form_before'); ?> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title"> <?php comment_form_title($args['title_reply'], $args['title_reply_to']); ?> <small><?php cancel_comment_reply_link($args['cancel_reply_link']); ?> </small> </h3> <?php if (get_option('comment_registration') && !is_user_logged_in()) { ?> <?php echo $args['must_log_in']; ?> <?php do_action('comment_form_must_log_in_after'); ?> <?php } else { ?> <form action="<?php echo site_url('/wp-comments-post.php'); ?> " method="post" id="<?php echo esc_attr($args['id_form']); ?> " class="form-horizontal comment-form"<?php echo $html5 ? ' novalidate' : ''; ?> role="form"> <?php do_action('comment_form_top'); ?> <?php if (is_user_logged_in()) { ?> <?php echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity); ?> <?php do_action('comment_form_logged_in_after', $commenter, $user_identity); ?> <?php } else { ?> <?php echo $args['comment_notes_before']; ?> <?php do_action('comment_form_before_fields'); foreach ((array) $args['fields'] as $name => $field) { echo apply_filters("comment_form_field_{$name}", $field) . "\n"; } do_action('comment_form_after_fields'); } echo apply_filters('comment_form_field_comment', $args['comment_field']); echo $args['comment_notes_after']; ?> <div class="form-submit"> <input class="btn btn-danger btn-lg" name="submit" type="submit" id="<?php echo esc_attr($args['id_submit']); ?> " value="<?php echo esc_attr($args['label_submit']); ?> " /> <?php comment_id_fields($post_id); ?> </div> <?php do_action('comment_form', $post_id); ?> </form> <?php } ?> </div><!-- #respond --> <?php do_action('comment_form_after'); } else { do_action('comment_form_comments_closed'); } }
</nav><!-- #comment-nav-below --> <?php } // check for comment navigation ?> <?php } // have_comments() ?> <?php // If comments are closed and there are comments, let's leave a little note, shall we? if (!comments_open() && '0' != get_comments_number() && post_type_supports(get_post_type(), 'comments')) { ?> <p class="no-comments"><?php _e('Comments are closed.', 'upbootwp'); ?> </p> <?php } ?> <?php // Arguments to edit the comment form $args = array('id_form' => 'commentform', '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'), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x('Comment', 'noun') . '</label><textarea id="comment" class="form-control" name="comment" cols="45" rows="8" aria-required="true">' . '</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()))) . '</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()))) . '</p>', 'comment_notes_before' => '<p class="comment-notes">' . __('Your email address will not be published.') . ($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 style="white-space: normal !important;">' . allowed_tags() . '</code>') . '</p>', 'fields' => apply_filters('comment_form_default_fields', array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('Name', 'domainreference') . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '<input id="author" class="form-control" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __('Email', 'domainreference') . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '<input id="email" class="form-control" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></p>', 'url' => '<p class="comment-form-url"><label for="url">' . __('Website', 'domainreference') . '</label>' . '<input id="url" class="form-control" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>'))); comment_form($args); ?> </div><!-- #comments -->
/> </p> <p><label for="url"><?php _e('Website', 'arras'); ?> </label><br /> <input type="text" name="url" id="s3" value="<?php echo $comment_author_url; ?> " size="40" tabindex="3" class="url" /> </p> <?php } ?> <p><?php printf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'arras'), allowed_tags()); ?> </p> <p> <textarea name="comment" id="s4" cols="50" rows="10" tabindex="4" class="required"></textarea> </p> <?php if (function_exists('show_subscription_checkbox')) { ?> <p><?php show_subscription_checkbox(); ?> </p> <?php } ?>
size="22" tabindex="3"/> <label for="url"> <small><?php _e('Website', 'nvLangScope'); ?> </small> </label></p> <?php } ?> <p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p> <p><small><?php printf(__('You can use these tags: <code>%s</code>', 'nvLangScope'), allowed_tags()); ?> </small></p> <p><input name="submit" type="submit" id="submit" tabindex="5" class="button" value="<?php esc_attr_e('Submit Comment', 'nvLangScope'); ?> "/> <?php comment_id_fields(); ?> </p> <?php do_action('comment_form', $post->ID); ?>
?> </div> </nav><!-- #comment-nav-below --> <?php } // check for comment navigation ?> <?php } // have_comments() ?> <?php // If comments are closed and there are comments, let's leave a little note, shall we? if (!comments_open() && '0' != get_comments_number() && post_type_supports(get_post_type(), 'comments')) { ?> <p class="no-comments"><?php _e('Comments are closed.', '_sx'); ?> </p> <?php } ?> <?php comment_form($args = array('id_form' => 'commentform', 'id_submit' => 'commentsubmit', 'title_reply' => __('Leave a Reply', '_sx'), 'title_reply_to' => __('Leave a Reply to %s', '_sx'), 'cancel_reply_link' => __('Cancel Reply', '_sx'), 'label_submit' => __('Post Comment', '_sx'), 'comment_field' => '<p><textarea placeholder="Start typing..." id="comment" class="form-control" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 'comment_notes_after' => '<p class="form-allowed-tags">' . __('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', '_sx') . '</p><div class="alert alert-info">' . allowed_tags() . '</div>')); ?> </div><!-- #comments -->
<?php // This file is part of the Carrington Theme for WordPress // http://carringtontheme.com // // Copyright (c) 2008 Crowd Favorite, Ltd. All rights reserved. // http://crowdfavorite.com // // Released under the GPL license // http://www.opensource.org/licenses/gpl-license.php // // ********************************************************************** // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // ********************************************************************** if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die; } if (CFCT_DEBUG) { cfct_banner(__FILE__); } global $post, $user_ID, $user_identity, $comment_author, $comment_author_email, $comment_author_url, $tpl; $req = get_option('require_name_email'); do_action('comment_form', $post->ID); $tpl[] = array("wpurl" => get_bloginfo('wpurl')); $tpl["comment_form"] = array("tpl_file" => "comment.html", "open" => $post->comment_status ? 1 : 0, "logged_in" => $user_ID ? 1 : 0, "must_login" => get_option('comment_registration') && !$user_ID ? 1 : 0, "logged_in_message" => sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'carrington'), get_bloginfo('wpurl') . '/wp-login.php?redirect_to=' . get_permalink()), "comment_label" => __('Post a comment', 'carrington'), "allowed_html_attribute" => sprintf(__('You can use: %s', 'carrington'), allowed_tags()), "allowed_html_message" => __('Some HTML is OK', 'carrington'), "logged_in_as" => sprintf(__('Logged in as <a href="%s">%s</a>.', 'carrington'), get_bloginfo('wpurl') . '/wp-admin/profile.php', $user_identity), "log_out_attribute" => __('Log out of this account', 'carrington'), "log_out_message" => __('Logout →', 'carrington'), "author_label" => __('Name', 'carrington'), "author_value" => $comment_author, "required" => $req ? 1 : 0, "required_message" => __('(required)', 'carrington'), "email_label" => __('Email', 'carrington'), "email_value" => $comment_author_email, "required_email_message" => __('(required, but never shared)', 'carrington'), "email_message" => __('(never shared)', 'carrington'), "url_attribute" => __('Your website address', 'carrington'), "url_label" => __('Web', 'carrington'), "url_value" => $comment_author_url, "submit_text" => __('Post comment', 'carrington'), "trackback_message" => sprintf(__('or, reply to this post via <a rel="trackback" href="%s">trackback</a>.', 'carrington'), get_trackback_url()), "post_id" => $post->ID);
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?> " size="22" tabindex="3" /> <label for="url"><small><?php _e('Website', 'lightword'); ?> </small></label></p> <?php } ?> <!--<p><small><strong>XHTML:</strong> <?php printf(__('You can use these tags: %s', 'lightword'), allowed_tags()); ?> </small></p>--> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php echo attribute_escape(__('Submit', 'lightword')); ?> " /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?> " /> </p>
/** * Shortcode function for showing the blog's allowed tags * Uses the allowed_tags() function * * @since 0.1 */ function shortcode_allowed_tags() { return allowed_tags(); }
function wpbootstrap_comment_form($defaults) { $req = get_option('require_name_email'); $defaults['comment_field'] = '' . '<div class="comment-form-comment form-group">' . '<label for="comment">' . __('Comment', "toolset_starter") . ($req ? ' <span class="required">*</span>' : '') . '</label>' . '<textarea id="comment" class="form-control" name="comment" rows="8" aria-required="true"></textarea>' . '</div>'; $defaults['comment_notes_after'] = '' . '<p class="form-allowed-tags help-block">' . sprintf(__('You may use these', "toolset_starter") . ' <abbr title="HyperText Markup Language">HTML</abbr> ' . __('tags and attributes:', "toolset_starter") . '%s', '<pre>' . allowed_tags() . '</pre>') . '</p>'; return $defaults; }
/** * Output a complete commenting form for use within a template. * * Most strings and form fields may be controlled through the $args array passed * into the function, while you may also choose to use the comment_form_default_fields * filter to modify the array of default fields if you'd just like to add a new * one or remove a single field. All fields are also individually passed through * a filter of the form comment_form_field_$name where $name is the key used * in the array of fields. * * @since 3.0.0 * @since 4.1.0 Introduced the 'class_submit' argument. * @since 4.2.0 Introduced 'submit_button' and 'submit_fields' arguments. * * @param array $args { * Optional. Default arguments and form fields to override. * * @type array $fields { * Default comment fields, filterable by default via the 'comment_form_default_fields' hook. * * @type string $author Comment author field HTML. * @type string $email Comment author email field HTML. * @type string $url Comment author URL field HTML. * } * @type string $comment_field The comment textarea field HTML. * @type string $must_log_in HTML element for a 'must be logged in to comment' message. * @type string $logged_in_as HTML element for a 'logged in as [user]' message. * @type string $comment_notes_before HTML element for a message displayed before the comment form. * Default 'Your email address will not be published.'. * @type string $comment_notes_after HTML element for a message displayed after the comment form. * Default 'You may use these HTML tags and attributes ...'. * @type string $id_form The comment form element id attribute. Default 'commentform'. * @type string $id_submit The comment submit element id attribute. Default 'submit'. * @type string $class_submit The comment submit element class attribute. Default 'submit'. * @type string $name_submit The comment submit element name attribute. Default 'submit'. * @type string $title_reply The translatable 'reply' button label. Default 'Leave a Reply'. * @type string $title_reply_to The translatable 'reply-to' button label. Default 'Leave a Reply to %s', * where %s is the author of the comment being replied to. * @type string $cancel_reply_link The translatable 'cancel reply' button label. Default 'Cancel reply'. * @type string $label_submit The translatable 'submit' button label. Default 'Post a comment'. * @type string $submit_button HTML format for the Submit button. * Default: '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />'. * @type string $submit_field HTML format for the markup surrounding the Submit button and comment hidden * fields. Default: '<p class="form-submit">%1$s %2$s</a>', where %1$s is the * submit button markup and %2$s is the comment hidden fields. * @type string $format The comment form format. Default 'xhtml'. Accepts 'xhtml', 'html5'. * } * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post. */ function comment_form($args = array(), $post_id = null) { if (null === $post_id) { $post_id = get_the_ID(); } $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; $args = wp_parse_args($args); if (!isset($args['format'])) { $args['format'] = current_theme_supports('html5', 'comment-form') ? 'html5' : 'xhtml'; } $req = get_option('require_name_email'); $aria_req = $req ? " aria-required='true'" : ''; $html_req = $req ? " required='required'" : ''; $html5 = 'html5' === $args['format']; $fields = array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('Name') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . $html_req . ' /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __('Email') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<input id="email" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30" aria-describedby="email-notes"' . $aria_req . $html_req . ' /></p>', 'url' => '<p class="comment-form-url"><label for="url">' . __('Website') . '</label> ' . '<input id="url" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>'); $required_text = sprintf(' ' . __('Required fields are marked %s'), '<span class="required">*</span>'); /** * Filter the default comment form fields. * * @since 3.0.0 * * @param array $fields The default comment fields. */ $fields = apply_filters('comment_form_default_fields', $fields); $defaults = array('fields' => $fields, 'comment_field' => '<p class="comment-form-comment"><label>コメントを書く<span class="red">(必須)</span></label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></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>'), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __('Your email address will not be published.') . '</span>' . ($req ? $required_text : '') . '</p>', 'comment_notes_after' => '<p class="form-allowed-tags" id="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' => 'commentform', 'id_submit' => 'submit', 'class_submit' => 'submit', 'name_submit' => 'submit', 'title_reply' => __('Leave a Reply'), 'title_reply_to' => __('Leave a Reply to %s'), 'cancel_reply_link' => __('Cancel reply'), 'label_submit' => __('Post Comment'), 'submit_button' => '<input name="%1$s" type="submit" id="%2$s" class="%3$s" value="%4$s" />', 'submit_field' => '<p class="form-submit">%1$s %2$s</p>', 'format' => 'xhtml'); /** * Filter the comment form default arguments. * * Use 'comment_form_default_fields' to filter the comment fields. * * @since 3.0.0 * * @param array $defaults The default comment form arguments. */ $args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults)); if (comments_open($post_id)) { ?> <?php /** * Fires before the comment form. * * @since 3.0.0 */ do_action('comment_form_before'); ?> <div id="respond" class="comment-respond"> <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title($args['title_reply'], $args['title_reply_to']); ?> <small><?php cancel_comment_reply_link($args['cancel_reply_link']); ?> </small></h3> <?php if (get_option('comment_registration') && !is_user_logged_in()) { ?> <?php echo $args['must_log_in']; ?> <?php /** * Fires after the HTML-formatted 'must log in after' message in the comment form. * * @since 3.0.0 */ do_action('comment_form_must_log_in_after'); ?> <?php } else { ?> <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' : ''; ?> > <?php /** * Fires at the top of the comment form, inside the form tag. * * @since 3.0.0 */ do_action('comment_form_top'); ?> <?php if (is_user_logged_in()) { ?> <?php /** * Filter the 'logged in' message for the comment form for display. * * @since 3.0.0 * * @param string $args_logged_in The logged-in-as HTML-formatted message. * @param array $commenter An array containing the comment author's * username, email, and URL. * @param string $user_identity If the commenter is a registered user, * the display name, blank otherwise. */ echo apply_filters('comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity); ?> <?php /** * Fires after the is_user_logged_in() check in the comment form. * * @since 3.0.0 * * @param array $commenter An array containing the comment author's * username, email, and URL. * @param string $user_identity If the commenter is a registered user, * the display name, blank otherwise. */ do_action('comment_form_logged_in_after', $commenter, $user_identity); ?> <?php } else { ?> <?php echo $args['comment_notes_before']; ?> <?php /** * Fires before the comment fields in the comment form. * * @since 3.0.0 */ do_action('comment_form_before_fields'); /** * Fires after the comment fields in the comment form. * * @since 3.0.0 */ do_action('comment_form_after_fields'); ?> <?php } ?> <?php /** * Filter the content of the comment textarea field for display. * * @since 3.0.0 * * @param string $args_comment_field The content of the comment textarea field. */ echo apply_filters('comment_form_field_comment', $args['comment_field']); foreach ((array) $args['fields'] as $name => $field) { /** * Filter a comment form field for display. * * The dynamic portion of the filter hook, `$name`, refers to the name * of the comment form field. Such as 'author', 'email', or 'url'. * * @since 3.0.0 * * @param string $field The HTML-formatted output of the comment form field. */ echo apply_filters("comment_form_field_{$name}", $field) . "\n"; } ?> <?php echo $args['comment_notes_after']; ?> <?php $submit_button = sprintf($args['submit_button'], esc_attr($args['name_submit']), esc_attr($args['id_submit']), esc_attr($args['class_submit']), esc_attr($args['label_submit'])); /** * Filter the submit button for the comment form to display. * * @since 4.2.0 * * @param string $submit_button HTML markup for the submit button. * @param array $args Arguments passed to `comment_form()`. */ $submit_button = apply_filters('comment_form_submit_button', $submit_button, $args); $submit_field = sprintf($args['submit_field'], $submit_button, get_comment_id_fields($post_id)); /** * Filter the submit field for the comment form to display. * * The submit field includes the submit button, hidden fields for the * comment form, and any wrapper markup. * * @since 4.2.0 * * @param string $submit_field HTML markup for the submit field. * @param array $args Arguments passed to comment_form(). */ echo apply_filters('comment_form_submit_field', $submit_field, $args); /** * Fires at the bottom of the comment form, inside the closing </form> tag. * * @since 1.5.0 * * @param int $post_id The post ID. */ do_action('comment_form', $post_id); ?> </form> <?php } ?> </div><!-- #respond --> <?php /** * Fires after the comment form. * * @since 3.0.0 */ do_action('comment_form_after'); } else { /** * Fires after the comment form if comments are closed. * * @since 3.0.0 */ do_action('comment_form_comments_closed'); } }
<p> <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?> " size="22" tabindex="3" /> <label for="url"><small> <?php _e('Website'); ?> </small></label> </p> <?php } ?> <!--<p><small><strong>XHTML:</strong> <?php printf(__('You can use these tags: %s'), allowed_tags()); ?> </small></p>--> <p> <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea> </p> <p> <input name="submit" type="submit" id="submit" tabindex="5" value="<?php echo attribute_escape(__('Submit Comment')); ?> " /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?> " /> </p>
/** * Display all of the allowed tags in HTML format with attributes. * * This is useful for displaying in the post area, which elements and * attributes are supported. As well as any plugins which want to display it. * * @since bbPress (r2780) * * @uses allowed_tags() To get the allowed tags * @uses apply_filters() Calls 'bbp_allowed_tags' with the tags * @return string HTML allowed tags entity encoded. */ function bbp_get_allowed_tags() { return apply_filters('bbp_get_allowed_tags', allowed_tags()); }
function render($params = array()) { global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage; global $gantry; $fparams = $this->_getParams($params); $comment_layout_name = 'comment_' . $fparams->commentLayout; $layout = $gantry->_getLayout($comment_layout_name); $className = 'GantryLayout' . ucfirst($comment_layout_name); // Do not delete these lines ob_start(); if (post_password_required()) { ?> <span class="alert"><?php _ge('This post is password protected. Enter the password to view comments.'); ?> </span> <?php return ob_get_clean(); } ?> <!-- You can start editing here. --> <?php if (have_comments()) { ?> <br/> <div class="comment-section"> <div class="contentheading"><?php comments_number(_g('No Comments'), _g('1 Comment'), _g('% Comments')); ?> </div> </div> <ol class="commentlist"> <?php wp_list_comments(array('style' => 'ol', 'callback' => array($className, 'render_comment'), 'reply_text' => _g('Reply'))); ?> </ol> <div class="rt-pagination nav"> <div class="alignleft"><?php next_comments_link('« ' . _g('Older Comments')); ?> </div> <div class="alignright"><?php previous_comments_link(_g('Newer Comments') . ' »'); ?> </div> <div class="clear"></div> </div> <?php } else { // this is displayed if there are no comments so far ?> <?php if (comments_open()) { ?> <!-- If comments are open, but there are no comments. --> <?php } else { // comments are closed ?> <!-- If comments are closed. --> <div class="attention"> <div class="icon"><?php _ge('Comments are closed.'); ?> </div> </div> <?php } ?> <?php } ?> <!-- RESPOND --> <?php if (comments_open()) { ?> <div id="respond"> <div class="comment-section"> <div class="contentheading"><?php comment_form_title(_g('Leave a Reply'), _g('Leave a Reply to %s')); ?> </div> </div> <div class="cancel-comment-reply"> <small><?php cancel_comment_reply_link(); ?> </small> </div> <?php if (get_option('comment_registration') && !is_user_logged_in()) { ?> <div class="attention"> <div class="icon"><?php _ge('You must be'); ?> <a href="<?php echo wp_login_url(get_permalink()); ?> "><?php _ge('logged in'); ?> </a> <?php _ge('to post a comment.'); ?> </div> </div> <?php } else { ?> <!-- Begin Form --> <form action="<?php echo get_option('siteurl'); ?> /wp-comments-post.php" method="post" id="commentform"> <?php if (is_user_logged_in()) { ?> <p><?php _ge('Logged in as'); ?> <a href="<?php echo get_option('siteurl'); ?> /wp-admin/profile.php"><?php echo $user_identity; ?> </a>. <a href="<?php echo wp_logout_url(get_permalink()); ?> " title="<?php _ge('Log out of this account'); ?> "><?php _ge('Log out'); ?> »</a></p> <?php } else { ?> <p> <input type="text" name="author" id="author" onblur="if(this.value=='') this.value='<?php _ge('Name (Required)'); ?> ';" onfocus="if(this.value=='<?php _ge('Name (Required)'); ?> ') this.value='';" value="Name (Required)" size="22" tabindex="1" <?php if ($req) { echo "aria-required='true'"; } ?> /> </p> <p> <input type="text" name="email" id="email" onblur="if(this.value=='') this.value='<?php _ge('E-mail (Required)'); ?> ';" onfocus="if(this.value=='<?php _ge('E-mail (Required)'); ?> ') this.value='';" value="E-mail (Required)" size="22" tabindex="2" <?php if ($req) { echo "aria-required='true'"; } ?> /> </p> <p> <input type="text" name="url" id="url" onblur="if(this.value=='') this.value='<?php _ge('Website'); ?> ';" onfocus="if(this.value=='<?php _ge('Website'); ?> ') this.value='';" value="Website" size="22" tabindex="3"/> </p> <?php } ?> <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?> </code></small></p>--> <p style="margin: 0;"> <textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea> </p><br/> <input class="button" name="submit" type="submit" id="submit" tabindex="5" value="<?php _ge('Submit'); ?> "/> <div class="clear"></div> <?php comment_id_fields(); ?> <?php do_action('comment_form', $post->ID); ?> </form> <!-- End Form --> <?php } // If registration required and not logged in ?> </div> <?php } // if you delete this the sky will fall on your head ?> <?php return ob_get_clean(); }
/** * Filters comments_form() default arguments * * @author Konstantin Obenland * @since 1.7.0 - 16.06.2012 * * @param array $defaults * * @return array */ function the_bootstrap_comment_form_defaults($defaults) { return wp_parse_args(array('comment_field' => '<div class="comment-form-comment control-group"><label class="control-label" for="comment">' . _x('Comment', 'noun', 'the-bootstrap') . '</label><div class="controls"><textarea class="span7" id="comment" name="comment" rows="8" aria-required="true"></textarea></div></div>', 'comment_notes_before' => '', 'comment_notes_after' => '<div class="form-allowed-tags control-group"><label class="control-label">' . sprintf(__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', 'the-bootstrap'), '</label><div class="controls"><pre>' . allowed_tags() . '</pre></div>') . '</div> <div class="form-actions">', 'title_reply' => '<legend>' . __('Leave a reply', 'the-bootstrap') . '</legend>', 'title_reply_to' => '<legend>' . __('Leave a reply to %s', 'the-bootstrap') . '</legend>', 'must_log_in' => '<div class="must-log-in control-group controls">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'the-bootstrap'), wp_login_url(apply_filters('the_permalink', get_permalink(get_the_ID())))) . '</div>', 'logged_in_as' => '<div class="logged-in-as control-group controls">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'the-bootstrap'), admin_url('profile.php'), wp_get_current_user()->display_name, wp_logout_url(apply_filters('the_permalink', get_permalink(get_the_ID())))) . '</div>'), $defaults); }
<p class="no-comments"><?php _e('Comments are closed.', 'bootstrap-basic'); ?> </p> <?php } //endif; ?> <?php $req = get_option('require_name_email'); $aria_req = $req ? " aria-required='true'" : ''; $html5 = true; // re-format comment allowed tags $comment_allowedtags = allowed_tags(); $comment_allowedtags = str_replace(array("\r\n", "\r", "\n"), '', $comment_allowedtags); $comment_allowedtags_array = explode('> <', $comment_allowedtags); $formatted_comment_allowedtags = ''; foreach ($comment_allowedtags_array as $item) { $formatted_comment_allowedtags .= '<code>'; if ($comment_allowedtags_array[0] != $item) { $formatted_comment_allowedtags .= '<'; } $formatted_comment_allowedtags .= $item; if (end($comment_allowedtags_array) != $item) { $formatted_comment_allowedtags .= '>'; } $formatted_comment_allowedtags .= '</code> '; } $comment_allowed_tags = $formatted_comment_allowedtags;
</div><!-- #form-section-email .form-section --> <div id="form-section-url" class="form-section"> <div class="form-label"><label for="url"><?php _e('Website', 'uthili') ?></label></div> <div class="form-input"><input id="url" name="url" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /></div> </div><!-- #form-section-url .form-section --> <?php endif /* if ( $user_ID ) */ ?> <div id="form-section-comment" class="form-section"> <div class="form-label"><label for="comment"><?php _e('Comment', 'uthili') ?></label></div> <div class="form-textarea"><textarea id="comment" name="comment" cols="45" rows="8" tabindex="6"></textarea></div> </div><!-- #form-section-comment .form-section --> <div id="form-allowed-tags" class="form-section"> <p><span><?php _e('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes:', 'uthili') ?></span> <code><?php echo allowed_tags(); ?></code></p> </div> <?php do_action('comment_form', $post->ID); ?> <div class="form-submit"><input id="submit" name="submit" type="submit" value="<?php _e('Post Comment', 'uthili') ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></div> <?php comment_id_fields(); ?> </form><!-- #commentform --> </div><!-- .formcontainer --> <?php endif /* if ( get_option('comment_registration') && !$user_ID ) */ ?> </div><!-- #respond --> <?php endif /* if ( 'open' == $post->comment_status ) */ ?> </div><!-- #comments -->
<?php // Custom Comment Form global $user_identity, $required_text; $commenter = wp_get_current_commenter(); $req = get_option('require_name_email'); $aria_req = $req ? " aria-required='true'" : ''; $required_text = __('<span class="required">Please fill the fields marked by <i class="icon-star"></i></span>', 'gsalborz'); $args = array('id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __('Leave a Reply', 'gsalborz'), 'title_reply_to' => __('Leave a Reply to %s', 'gsalborz'), 'cancel_reply_link' => __('Cancel Reply<i class="fa fa-remove"></i>', 'gsalborz'), 'label_submit' => __('Post Comment', 'gsalborz'), 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __('<i class="icon-doc-text"></i> Comment', 'gsalborz') . '</label></p><p><textarea id="comment" name="comment" placeholder="' . __('your message', 'gsalborz') . '" cols="70" rows="8" aria-required="true">' . '</textarea></p>', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'gsalborz'), wp_login_url(apply_filters('the_permalink', get_permalink()))) . '</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>', 'gsalborz'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p>', 'comment_notes_before' => '<p class="comment-notes">' . __('Your email address will not be published.', 'gsalborz') . '</p><p>' . ($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', 'gsalborz'), ' <code>' . allowed_tags() . '</code>') . '</p>', 'fields' => apply_filters('comment_form_default_fields', array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('<i class="fa fa-user"></i> Name', 'gsalborz') . '</label></p><p><input id="author" name="author" type="text" placeholder="' . __('yourname', 'gsalborz') . '" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' />' . ($req ? '<span class="required"></span>' : '') . '</p>', 'email' => '<p class="comment-form-email"><label for="email">' . __('<i class="fa fa-envelope"></i> Email', 'gsalborz') . '</label></p><p><input id="email" name="email" type="text" placeholder="' . __('*****@*****.**', 'gsalborz') . '" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' />' . ($req ? '<span class="required"></span>' : '') . '</p>', 'url' => '<p class="comment-form-url"><label for="url">' . __('<i class="fa fa-link"></i> Website', 'gsalborz') . '</label></p><p>' . '<input id="url" name="url" type="text" placeholder="' . __('www.example.com', 'gsalborz') . '" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>'))); comment_form($args);
<?php } // have_comments() ?> <?php // If comments are closed and there are comments, let's leave a little note, shall we? if (!comments_open() && '0' != get_comments_number() && post_type_supports(get_post_type(), 'comments')) { ?> <p class="nocomments"><?php _e('Comments are closed.', 'the7mk2'); ?> </p> <?php } ?> <?php $commenter = wp_get_current_commenter(); $req = get_option('require_name_email'); $aria_req = $req ? " aria-required='true'" : ''; $required_text = sprintf(' ' . __('Required fields are marked %s', 'the7mk2'), '<span class="required">*</span>'); $comment_form_args = array('title_reply' => '', 'title_reply_to' => '', 'fields' => apply_filters('comment_form_default_fields', array('author' => '<div class="form-fields"><span class="comment-form-author">' . '<label class="assistive-text" for="author">' . __('Name *', 'the7mk2') . '</label><input id="author" name="author" type="text" placeholder="' . __('Name*', 'the7mk2') . '" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></span>', 'email' => '<span class="comment-form-email"><label class="assistive-text" for="email">' . __('Email *', 'the7mk2') . '</label><input id="email" name="email" type="text" placeholder="' . __('Email*', 'the7mk2') . '" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></span>', 'url' => '<span class="comment-form-url"><label class="assistive-text" for="url">' . __('Website', 'the7mk2') . '</label><input id="url" name="url" type="text" placeholder="' . __('Website', 'the7mk2') . '" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></span></div>')), 'comment_field' => '<p class="comment-form-comment"><label class="assistive-text" for="comment">' . __('Comment', 'the7mk2') . '</label><textarea id="comment" placeholder="' . __('Comment', 'the7mk2') . '" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 'comment_notes_after' => '<p class="form-allowed-tags text-small wf-mobile-hidden">' . sprintf(__('You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s', 'the7mk2'), ' <code>' . allowed_tags() . '</code>') . '</p>', 'must_log_in' => '<p class="must-log-in text-small">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'the7mk2'), wp_login_url(apply_filters('the_permalink', get_permalink()))) . '</p>', 'logged_in_as' => '<p class="logged-in-as text-small">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'the7mk2'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p>', 'comment_notes_before' => '<p class="comment-notes text-small">' . __('Your email address will not be published.', 'the7mk2') . ($req ? $required_text : '') . '</p>'); ?> <?php comment_form($comment_form_args); ?> </div><!-- #comments .comments-area -->
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?> " size="22" tabindex="3" /> <label for="url"><small><?php _e('Website', 'emire'); ?> </small></label></p> <?php } ?> <!--<p><small><?php printf(__('<strong>XHTML:</strong> You can use these tags: %s'), allowed_tags()); ?> </small></p>--> <p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'emire'); ?> " /> <?php comment_id_fields(); ?> </p> <?php do_action('comment_form', $post->ID);
_e('No comments yet.'); ?> </p> <?php } ?> <?php if (comments_open()) { ?> <h2><?php _e('Leave a comment'); ?> </h2> <p><?php printf(__('Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code>%s</code>'), allowed_tags()); ?> </p> <form action="<?php echo site_url(); ?> /wp-comments-post.php" method="post" id="commentform"> <?php if ($user_ID) { ?> <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out </a>'), get_edit_user_link(), $user_identity, wp_logout_url(get_permalink())); ?> </p> <?php
} } ?> <?php if ('open' == $post->comment_status) { ?> <div id="comment-form"> <div class="formhead"><?php _e('Have your say', 'hemingwayex'); ?> </div> <p><small><strong>XHTML:</strong> <?php _e('You can use these tags: ', 'hemingwayex'); echo allowed_tags(); ?> </small></p> <?php if (get_option('comment_registration') && !$user_ID) { ?> <p><?php printf(__('You must be %s to post a comment.', 'hemingwayex'), '<a href="' . get_option('siteurl') . '/wp-login.php?redirect_to=' . the_permalink() . '">logged in</a>'); ?> </p> <?php } else { ?> <form action="<?php echo get_option('siteurl'); ?>
wp-comments-post.php" method="post"> <label class="comment-form-title"> <?php comment_form_title(__('Post a comment', 'carrington-jam'), __('Reply to %s', 'carrington-jam')); ?> </label> <span class="cancel-reply-link"> <?php cancel_comment_reply_link(); ?> </span> <p class="html-allowed"> <abbr title="<?php printf(__('You can use: %s', 'carrington-jam'), allowed_tags()); ?> "> <?php _e('Some HTML is OK', 'carrington-jam'); ?> </abbr> </p> <textarea name="comment" id="comment" rows="8" cols="40" tabindex="1"></textarea> <?php if (is_user_logged_in()) { ?> <p class="logged-in-as"><?php printf(__('Logged in as <a href="%s">%s</a>. ', 'carrington-jam'), get_bloginfo('wpurl') . '/wp-admin/profile.php', $user_identity); wp_loginout();