示例#1
2
 /**
  * Comment form renderer function.
  *
  * @return void
  */
 function adventure_tours_comment_form_renderer()
 {
     $commenter = wp_get_current_commenter();
     $fields = array('author' => '<div class="row"><div class="col-sm-4">' . '<label for="author">' . esc_html__('Name', 'adventure-tours') . '*</label>' . '<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" />' . '</div>', 'email' => '<div class="col-sm-4">' . '<label for="email">' . esc_html__('Email', 'adventure-tours') . '*</label>' . '<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" />' . '</div>', 'url' => '<div class="col-sm-4">' . '<label for="url">' . esc_html__('Website', 'adventure-tours') . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" />' . '</div></div>');
     $args = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_notes_before' => '', 'comment_notes_after' => '', 'comment_field' => '<label for="comment">' . esc_html__('Comment', 'adventure-tours') . '</label><textarea id="comment" name="comment"></textarea>', 'label_submit' => '', 'cancel_reply_link' => '<i class="fa fa-times"></i>');
     ob_start();
     comment_form($args);
     $formHtml = '<div class="comments__form">' . ob_get_clean() . '</div>';
     wp_enqueue_script('comment-reply');
     echo str_replace('<input name="submit" type="submit" id="submit" class="submit" value="" />', '<button type="submit" class="atbtn"><i class="atbtn__icon fa fa-comment"></i>' . esc_html__('Post Comment', 'adventure-tours') . '</button>', $formHtml);
 }
示例#2
1
function bootstrap3_comment_form_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $html5 = current_theme_supports('html5', 'comment-form') ? 1 : 0;
    $fields = array('author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __('Name') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<input class="form-control" id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></div>', 'email' => '<div class="form-group comment-form-email"><label for="email">' . __('Email') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<input class="form-control" id="email" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></div>', 'url' => '<div class="form-group comment-form-url"><label for="url">' . __('Website') . '</label> ' . '<input class="form-control" id="url" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></div>');
    return $fields;
}
示例#3
1
 /**
  * Filter the comment fields to get more custom HTML.
  * @param $fields
  */
 function ultra_filter_comment_fields($fields)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $aria_req = $req ? " aria-required='true'" : '';
     $html_req = $req ? " required='required'" : '';
     $html5 = true;
     $fields['author'] = '<div class="comment-form-author"><input id="author" name="author" placeholder="' . esc_attr__('Name *', 'ultra') . '" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . $html_req . ' /></div>';
     $fields['email'] = '<div class="comment-form-email"><input id="email" name="email" placeholder="' . esc_attr__('Email *', 'ultra') . '" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30" aria-describedby="email-notes"' . $aria_req . $html_req . ' /></div>';
     $fields['url'] = '<div class="comment-form-url"><input id="url" name="url" placeholder="' . esc_attr__('Website', 'ultra') . '" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></div>';
     return $fields;
 }
示例#4
0
 function zacklive_comment_form($args)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $args['fields'] = array('author' => '
         <div class="comment-form-author form-group">
             <input id="author" name="author" class="form-control" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . ($req ? " aria-required='true'" : '') . ' placeholder="' . __('Your Name', 'zacklive') . ($req ? '*' : '') . '" />
         </div>
     ', 'email' => '
         <div class="comment-form-email form-group">
             <input id="email" name="email" class="form-control" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . ($req ? " aria-required='true'" : '') . ' placeholder="' . __('Your Email', 'zacklive') . ($req ? '*' : '') . '" />
         </div>
     ', 'url' => '
         <div class="comment-form-url last form-group">
             <input id="url" name="url" class="form-control" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" placeholder="' . __('Your Website', 'zacklive') . '" />
         </div>
     ');
     $args['comment_notes_before'] = "";
     $args['comment_notes_after'] = '';
     $args['label_submit'] = "Submit";
     $args['comment_field'] = '
     <div class="comment-form-comment form-group">
         <textarea id="comment" name="comment" class="form-control" cols="45" rows="8" aria-required="true" placeholder="' . __('Your Comment Here ...', 'zacklive') . '"></textarea>
     </div>
 ';
     return $args;
 }
示例#5
0
/**
 * Alter comment form fields `Author`, `Email` and `Website`
 *
 * @param  Array $fields Fields.
 * @return Array         Fields altered.
 */
function bootswatch_comment_form_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $required = $req ? 'required' : '';
    $aria_required = $req ? 'true' : '';
    $div_tpl = '<div class="form-group comment-form-{{field}}">{{label}} {{input}}</div>';
    $label_tpl = '<label for="{{field}}" class="col-sm-2 control-label">{{label}}{{required}}</label>';
    $input_tpl = '<div class="col-sm-10"><input{{param}}></div>';
    $fields_parameters = array('author' => array('label' => __('Name'), 'type' => 'text', 'value' => esc_attr($commenter['comment_author']), 'required' => $required, 'aria-required' => $aria_required, 'size' => 30, 'maxlength' => 245), 'email' => array('label' => __('Email'), 'type' => 'email', 'value' => esc_attr($commenter['comment_author_email']), 'required' => $required, 'aria-required' => $aria_required, 'size' => 30, 'maxlength' => 100, 'describedby' => 'email-notes'), 'url' => array('label' => __('Website'), 'type' => 'url', 'value' => esc_attr($commenter['comment_author_url']), 'size' => 30, 'maxlength' => 200));
    foreach ($fields_parameters as $field => $parameter) {
        // Add some defaults to field.
        $parameter += array('id' => $field, 'name' => $field, 'class' => 'form-control');
        // Build <input>.
        $input = $input_tpl;
        foreach (array('name', 'id', 'type', 'value', 'required', 'aria-required', 'size', 'maxlength', 'describedby', 'class') as $p) {
            if (!empty($parameter[$p])) {
                $input = str_replace('{{param}}', sprintf(' %s="%s"{{param}}', $p, $parameter[$p]), $input);
            }
        }
        $input = str_replace('{{param}}', '', $input);
        // Build <label>.
        $label = $label_tpl;
        $label = str_replace('{{label}}', $parameter['label'], $label);
        $label = str_replace('{{required}}', !empty($parameter['required']) ? ' <span class="required">*</span>' : '', $label);
        // Build field <div>.
        $div = $div_tpl;
        $div = str_replace(array('{{input}}', '{{label}}', '{{field}}'), array($input, $label, $field), $div);
        // Add field to $fields array.
        $fields[$field] = $div;
    }
    return $fields;
}
function comments_template( $file = '/comments.php' ) {
	global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity;

	if ( ! (is_single() || is_page() || $withcomments) )
		return;

	$req = get_settings('require_name_email');
	$commenter = wp_get_current_commenter();
	extract($commenter);

	// TODO: Use API instead of SELECTs.
	if ( empty($comment_author) ) {
		$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date");
	} else {
		$author_db = $wpdb->escape($comment_author);
		$email_db  = $wpdb->escape($comment_author_email);
		$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND ( comment_approved = '1' OR ( comment_author = '$author_db' AND comment_author_email = '$email_db' AND comment_approved = '0' ) ) ORDER BY comment_date");
	}

	define('COMMENTS_TEMPLATE', true);
	$include = apply_filters('comments_template', TEMPLATEPATH . $file );
	if ( file_exists( $include ) )
		require( $include );
	else
		require( ABSPATH . 'wp-content/themes/default/comments.php');
}
示例#7
0
function lrl_custom_form_filters($args = array(), $post_id = null)
{
    global $id;
    $options = get_option('bootstrap_theme');
    $custom_comment_message = isset($options['comment_form_text']) ? $options['comment_form_text'] : null;
    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' => '
			<div class="comment-form-author clearfix">' . ' ' . '<input id="author" name="author" placeholder="Enter your Name..." type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' />
			</div>', 'email' => '
			<div class="comment-form-email clearfix">
			' . '<input id="email" name="email" placeholder="Enter your Email Address..." type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' />
			</div>', 'url' => '
			<div class="comment-form-url clearfix">
			' . '<input id="url" name="url" placeholder="Enter your Website..." type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" />
			</div>');
    $required_text = sprintf(' ' . __('Required fields are marked %s', 'bootstrap'), '<span class="required">*</span>');
    $defaults = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>', '', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'bootstrap'), 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>', 'bootstrap'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'comment_notes_before' => null, 'comment_notes_after' => null, 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => sprintf(__('Have a Comment?', 'bootstrap'), apply_filters('lrl_comment_form_message', $custom_comment_message)), 'title_reply_to' => __('Leave a Reply to %s', 'bootstrap'), 'cancel_reply_link' => __('Cancel', 'bootstrap'), 'label_submit' => __('Submit Comment', 'bootstrap'));
    return $defaults;
}
示例#8
0
/**
 * Filters the WordPress comment_form() function that was added in WordPress 3.0.  This allows
 * the theme to preserve some backwards compatibility with its old comment form.  It also allows
 * users to build custom comment forms by filtering 'comment_form_defaults' in their child theme.
 *
 * @since 1.0
 * @param array $defaults The default comment form arguments.
 * @return array $args The filtered comment form arguments.
 */
function momtaz_comment_form_args($defaults)
{
    $args = array();
    // Remove the notes after the form.
    $args['comment_notes_after'] = '';
    // Get current commenter's name, email, and URL.
    $commenter = wp_get_current_commenter();
    // Is the "Name" and "Email" fields are required?
    $required = (bool) get_option('require_name_email');
    /*** Comment Form Fields **************************************************/
    $args['fields'] = Nmwdhj\create_elements(array('author' => array('atts' => array('required' => (bool) $required), 'value' => $commenter['comment_author'], 'label' => __('Name', 'momtaz'), 'type' => 'input_text', 'nid' => 'author'), 'email' => array('atts' => array('required' => (bool) $required), 'value' => $commenter['comment_author_email'], 'label' => __('Email', 'momtaz'), 'type' => 'input_email', 'nid' => 'email'), 'url' => array('value' => $commenter['comment_author_url'], 'label' => __('Website', 'momtaz'), 'type' => 'input_url', 'nid' => 'url')));
    // Shared
    foreach ($args['fields'] as $k => $e) {
        if ($e->get_attr('required')) {
            $label = $e->get_option('label');
            if (!empty($label)) {
                $label .= '<span class="required">*</span>';
                $e->set_option('label', $label);
            }
        }
        $e->set_options(array('wrapper_atts' => array('class' => 'form-section layout-columned'), 'label_atts' => array('class' => 'form-label'), 'wrapper' => 'div'), true);
        $e->set_atts(array('class' => 'form-field regular-textbox', 'size' => 40));
        $args['fields'][$k] = $e->get_output();
    }
    // Comment Text
    $args['comment_field'] = Nmwdhj\create_element(array('type' => 'textarea', 'nid' => 'comment', 'atts' => array('class' => 'form-field large-textbox', 'required' => true, 'rows' => 10, 'cols' => 60), 'wrapper' => 'div', 'wrapper_atts' => array('class' => 'form-section layout-full')))->get_output();
    $args = wp_parse_args($args, $defaults);
    return $args;
}
示例#9
0
function progo_bootstrap3_comment_form_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $required = $req ? ' aria-required="true" required ' : '';
    $fields = array('author' => '<div class="form-group comment-form-author">' . '<label for="author">' . __('Name', 'pgb') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<div class="input-group"><span class="input-group-addon glyphicon glyphicon-user"></span><input class="form-control" id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $required . ' /></div></div>', 'email' => '<div class="form-group comment-form-email"><label for="email">' . __('Email', 'pgb') . ($req ? ' <span class="required">*</span>' : '') . '</label> ' . '<div class="input-group"><span class="input-group-addon glyphicon glyphicon-envelope"></span><input class="form-control" id="email" name="email" type="email" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $required . ' /></div></div>', 'url' => '<div class="form-group comment-form-url"><label for="url">' . __('Website', 'pgb') . '</label> ' . '<div class="input-group"><span class="input-group-addon glyphicon glyphicon-globe"></span><input class="form-control" id="url" name="url" type="url" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></div></div>');
    return $fields;
}
示例#10
0
function ep_comment_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $fields['author'] = "<div class=\"input-text\"><input name=\"author\" value=\"" . esc_attr($commenter['comment_author']) . "\" type=\"text\" tabindex=\"1\"><span class=\"label\">" . __('Your Name', 'epicomedia') . "</span><span class=\"graylabel\">" . __('Your Name', 'epicomedia') . "</span></div>";
    $fields['email'] = "<div class=\"input-text\"><input name=\"email\" value=\"" . esc_attr($commenter['comment_author_email']) . "\" type=\"text\" tabindex=\"2\"><span class=\"label\">" . __('Email', 'epicomedia') . "</span><span class=\"graylabel\">" . __('Email', 'epicomedia') . "</span></div>";
    $fields['url'] = "<div  class=\"input-text\"><input name=\"url\" value=\"" . esc_attr($commenter['comment_author_url']) . "\" type=\"text\" tabindex=\"3\"><span class=\"label\">" . __('WEBSITE', 'epicomedia') . "</span><span class=\"graylabel\">" . __('WEBSITE', 'epicomedia') . "</span></div>";
    return $fields;
}
示例#11
0
function mixed_custom_comment_fields()
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $fields = array('author' => '<p>' . '<input id="author" name="author" type="text" class="form-control" placeholder="Name ( required )" value="' . esc_attr($commenter['comment_author']) . '" ' . $aria_req . ' />' . '</p>', 'email' => '<p>' . '<input id="email" name="email" type="text" class="form-control" placeholder="Email ( required )" value="' . esc_attr($commenter['comment_author_email']) . '" ' . $aria_req . ' />' . '</p>', 'url' => '<p>' . '<input id="url" name="url" type="text" class="form-control" placeholder="Website" value="' . esc_attr($commenter['comment_author_url']) . '" />' . '</p>');
    return $fields;
}
示例#12
0
/**
 * Unset the website field, Remove the required *
 */
function aventurine_comment_fields($fields)
{
    $commenter = wp_get_current_commenter();
    unset($fields['url']);
    $fields['author'] = sprintf('<p class="comment-form-author"><label for="author">%1$s</label> <input id="author" name="author" type="text" value="%2$s" size="30" aria-required="true" placeholder="%1$s" /></p>', __('Name', 'aventurine'), esc_attr($commenter['comment_author']));
    $fields['email'] = sprintf('<p class="comment-form-email"><label for="email">%1$s</label><input id="email" name="email" type="email" value="%2$s" size="30" aria-required="true" placeholder="%1$s" /></p>', __('Email', 'aventurine'), esc_attr($commenter['comment_author_email']));
    return $fields;
}
示例#13
0
    /**
     * Hook to set the email input of the comment form as email type
     * (usefull for tablet and mobile)
     *
     * @param array $default
     * @return array $default
     */
    function wolf_change_comment_form_defaults($default)
    {
        $commenter = wp_get_current_commenter();
        $req = get_option('require_name_email');
        $aria_req = $req ? " aria-required='true'" : '';
        $default['fields']['email'] = '<p class="comment-form-email">
		<label for="email">' . __('Email', 'wolf') . ' ' . ($req ? '<span class="required">*</span>' : '') . '</label><input id="email" name="email" type="email" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></p>';
        return $default;
    }
示例#14
0
 function modify_comment_form_fields($fields)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $fields['author'] = '<p class="inputrow"><input type="text" name="author" id="author" value="' . esc_attr($commenter['comment_author']) . '" placeholder="' . __("Name", "Vela") . ' (' . __('Required', 'Vela') . ')" size="22" tabindex="1"' . ($req ? ' required' : '') . ' /></p>';
     $fields['email'] = '<p class="inputrow"><input type="text" name="email" id="email" value="' . sanitize_email($commenter['comment_author_email']) . '" placeholder="' . __("Email", "Vela") . ' (' . __('Required', 'Vela') . ')" size="22" tabindex="2"' . ($req ? ' required' : '') . '  /></p>';
     $fields['url'] = '<p class="inputrow"><input type="text" name="url" id="url" value="' . esc_url($commenter['comment_author_url']) . '" placeholder="' . __("Website", "Vela") . '" size="22" tabindex="3" /></p>';
     return $fields;
 }
示例#15
0
function flatter_comment_form_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $html5 = current_theme_supports('html5', 'comment-form') ? 1 : 0;
    $fields = array('author' => '<div class="col-sm-12 form-group comment-form-author">' . '<input class="form-control" id="author" name="author" type="text" placeholder="* Full Name" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></div>', 'email' => '<div class="col-sm-12 form-group comment-form-email">' . '<input class="form-control" id="email" placeholder="* Email Address" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></div>', 'url' => '<div class=" col-sm-12 form-group comment-form-url">' . '<input class="form-control" id="url" placeholder="Website" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></div>');
    return $fields;
}
示例#16
0
 /**
  * Modify comment form default fields
  */
 public function comment_form_fields($fields)
 {
     $req = get_option('require_name_email');
     $html5 = 'html5';
     $commenter = wp_get_current_commenter();
     $aria_req = $req ? " aria-required='true'" : '';
     $fields = array('author' => View::make('blocks/comment_form_fields/author', array('placeholder' => __('Name', 'photolab') . ($req ? '*' : ''), 'value' => esc_attr($commenter['comment_author']), 'aria_req' => $aria_req)), 'email' => View::make('blocks/comment_form_fields/email', array('type' => $html5 ? 'type="email"' : 'type="text"', 'placeholder' => __('Email', 'photolab') . ($req ? '*' : ''), 'value' => esc_attr($commenter['comment_author_email']), 'aria_req' => $aria_req)), 'url' => View::make('blocks/comment_form_fields/author', array('type' => $html5 ? 'type="url"' : 'type="text"', 'placeholder' => __('Website', 'photolab'), 'value' => esc_attr($commenter['comment_author_url']), 'aria_req' => $aria_req)));
     return $fields;
 }
示例#17
0
function bootstrap3_comment_form_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $html5 = current_theme_supports('html5', 'comment-form') ? 1 : 0;
    $fields = array('author' => '<div class="form-group comment-form-author required"><input required class="form-control" id="author" name="author" type="text" placeholder="Dit navn" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></div>', 'email' => '<div class="form-group comment-form-email required"><input required class="form-control" id="email" placeholder="Din e-mail (bliver ikke vist)" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></div>', 'url' => '<div class="form-group comment-form-url"><input class="form-control" id="url" placeholder="Evt. Website" name="url" ' . ($html5 ? 'type="url"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></div>');
    return $fields;
}
 /**
  * Applies BuddyPress customisations to the post comment form.
  *
  * @param array $default_labels The default options for strings, fields etc in the form
  * @see comment_form()
  * @since BuddyPress (1.5)
  */
 function bp_dtheme_comment_form($default_labels)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $aria_req = $req ? " aria-required='true'" : '';
     $fields = array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('Name', 'logicalboneshug') . ($req ? '<span class="required"> *</span>' : '') . '</label> ' . '<input id="author" 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', 'logicalboneshug') . ($req ? '<span class="required"> *</span>' : '') . '</label> ' . '<input id="email" 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', 'logicalboneshug') . '</label>' . '<input id="url" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>');
     $new_labels = array('comment_field' => '<p class="form-textarea"><textarea name="comment" id="comment" cols="60" rows="10" aria-required="true"></textarea></p>', 'fields' => apply_filters('comment_form_default_fields', $fields), 'logged_in_as' => '', 'must_log_in' => '<p class="alert">' . sprintf(__('You must be <a href="%1$s">logged in</a> to post a comment.', 'logicalboneshug'), wp_login_url(get_permalink())) . '</p>', 'title_reply' => __('Leave a reply', 'logicalboneshug'));
     return apply_filters('bp_dtheme_comment_form', array_merge($default_labels, $new_labels));
 }
示例#19
0
function bootstrap3_comment_form_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $html5 = current_theme_supports('html5', 'comment-form') ? 1 : 0;
    $fields = array('author' => '<div class="row"><div class="col-md-6 col-xs-12 col-sm-6"><div class="form-group comment-form-author">' . '<input class="form-control" placeholder="' . __('Your Name', STM_DOMAIN) . ($req ? ' *' : '') . '" id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></div></div>', 'email' => '<div class="col-md-6 col-xs-12 col-sm-6"><div class="form-group comment-form-email">' . '<input class="form-control" placeholder="' . __('Your Email', STM_DOMAIN) . ($req ? ' *' : '') . '" id="email" name="email" ' . ($html5 ? 'type="email"' : 'type="text"') . ' value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></div></div></div>');
    return $fields;
}
 public function comment_form_fields($fields)
 {
     $commenter = wp_get_current_commenter();
     $fields['author'] = "\n<fieldset id=\"lh_comments-fieldset\" class=\"comment-form-author lh-comment-navigation-input\"><legend>Fill in your details below or <a href=\"" . wp_login_url() . "\" title=\"login to comment\">login</a></legend><!--[if lt IE 10]><br/><label for=\"author\">" . __('Your Name', 'theme_text_domain') . ($req ? '<span class="required">*</span>' : '') . '</label><![endif]--> ' . '<input id="author" name="author" placeholder="Your Name (required)" type="text" value="' . esc_attr($commenter['comment_author']) . '" class="required" required="required" />' . "</p>\n\n";
     $fields['email'] = "\n<p class=\"comment-form-email lh-comment-navigation-input\"><!--[if lt IE 10]><label for=\"email\">" . __('Your Email', 'theme_text_domain') . ($req ? '<span class="required">*</span>' : '') . '</label><![endif]--> ' . '<input id="email" name="email" placeholder="Your Email (required - never published)" type="email" value="' . esc_attr($commenter['comment_author_email']) . '" size="40"' . ' class="required email" required="required" />' . "</fieldset>\n\n";
     $fields['url'] = '';
     //$fields['lh_comments_check']  = '<input type="hidden" name="lh_comments_check" value="" id="lh_comments_check" />';
     return $fields;
 }
示例#21
0
 function modify_comment_form_fields($fields)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $fields['author'] = '<div id="comment-input"><input type="text" name="author" id="author" value="' . esc_attr($commenter['comment_author']) . '" placeholder="' . __("Name (required)", "Avada") . '" size="22" tabindex="1" ' . ($req ? 'aria-required="true"' : '') . ' class="input-name" />';
     $fields['email'] = '<input type="text" name="email" id="email" value="' . esc_attr($commenter['comment_author_email']) . '" placeholder="' . __("Email (required)", "Avada") . '" size="22" tabindex="2" ' . ($req ? 'aria-required="true"' : '') . ' class="input-email"  />';
     $fields['url'] = '<input type="text" name="url" id="url" value="' . esc_attr($commenter['comment_author_url']) . '" placeholder="' . __("Website", "Avada") . '" size="22" tabindex="3" class="input-website" /></div>';
     return $fields;
 }
示例#22
0
 public function modify_comment_form_fields($fields)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $aria_req = $req ? " aria-required='true'" : '';
     $fields['author'] = '<p class="comment-form-author">' . '<input id="author" name="author" type="text" placeholder="Your name *" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></p>';
     $fields['email'] = '<p class="comment-form-email">' . '<input id="email" name="email" type="text" placeholder="Your email *" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></p>';
     $fields['url'] = '<p class="comment-form-url">' . '<input id="url" name="url" type="text" placeholder="Website (Optional)" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>';
     return $fields;
 }
示例#23
0
 function modify_comment_form_fields($fields)
 {
     $commenter = wp_get_current_commenter();
     $req = get_option('require_name_email');
     $fields['author'] = '<div class="row"><div class="col-md-6"><div class="form-group">
                         <input type="text" name="author" id="author" value="' . esc_attr($commenter['comment_author']) . '" placeholder="' . __("Name", "cuvey") . '" size="22" tabindex="1"' . ($req ? 'aria-required="true"' : '') . ' class="form-control" /></div>';
     $fields['email'] = '<div class="form-group"><input type="text" name="email" id="email" value="' . esc_attr($commenter['comment_author_email']) . '" placeholder="' . __("Your Email", "cuvey") . '" size="22" tabindex="2"' . ($req ? 'aria-required="true"' : '') . ' class="form-control"/></div>';
     $fields['url'] = '<div class="form-group"><input type="text" name="url" id="url" value="' . esc_attr($commenter['comment_author_url']) . '" placeholder="' . __("Website", "cuvey") . '" size="22" tabindex="3" class="form-control" /></div></div>';
     return $fields;
 }
示例#24
0
function ktz_com_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $fields['author'] = '<div class="row"><div class="col-md-4"><div class="form-group has-feedback"><label class="control-label sr-only" for="author">Name</label><input type="text" name="author" class="form-control btn-box" id="form-control" placeholder="' . __('Name', ktz_theme_textdomain) . ' ' . ($req ? __('*', ktz_theme_textdomain) : '') . '" value="' . esc_attr($commenter['comment_author']) . '" size="30" tabindex="1" ' . $aria_req . ' /><span class="glyphicon glyphicon-user form-control-feedback"></span></div></div>';
    $fields['email'] = '<div class="col-md-4"><div class="form-group has-feedback"><label class="control-label sr-only" for="email">Email</label><input type="text" name="email" class="form-control btn-box" id="form-control" placeholder="' . __('Email', ktz_theme_textdomain) . ' ' . ($req ? __('*', ktz_theme_textdomain) : '') . '" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" tabindex="2" ' . $aria_req . ' /><span class="glyphicon glyphicon-envelope form-control-feedback"></span></div></div>';
    $fields['url'] = '<div class="col-md-4"><div class="form-group has-feedback"><label class="control-label sr-only" for="url">URL</label><input type="text" name="url" class="form-control btn-box" id="form-control" placeholder="' . __('Website', ktz_theme_textdomain) . ' ' . ($req ? __('*', ktz_theme_textdomain) : '') . '" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" tabindex="3" ' . $aria_req . ' /><span class="glyphicon glyphicon-globe form-control-feedback"></span></div></div></div>';
    return $fields;
}
示例#25
0
function comment_form_custom_fields($fields)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $fields['author'] = '<p><label for="name">' . __('Your Name', TEMPLATENAME) . ': ' . ($req ? '<small>(' . __('required', TEMPLATENAME) . ')</small>' : '') . '</label>' . '<input id="name" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></p>';
    $fields['email'] = '<p><label for="email">' . __('E-mail', TEMPLATENAME) . ': ' . ($req ? '<small>(' . __('will not be published', TEMPLATENAME) . ') (' . __('required', TEMPLATENAME) . ')</small>' : '') . '</label>' . '<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></p>';
    $fields['url'] = '<p><label for="website">' . __('Website', TEMPLATENAME) . ': </label>' . '<input id="website" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /></p>';
    return $fields;
}
示例#26
0
function gsc_comment_form_args($args)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req && gsc_get_option('genesis_comment_form_args_fields_aria_display') ? ' aria-required="true"' : '';
    $args = array('fields' => array('author' => '<p class="comment-form-author">' . '<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30" tabindex="1"' . $aria_req . ' />' . '<label for="author">' . esc_attr(gsc_get_option('genesis_comment_form_args_fields_author_label')) . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '</p><!-- #form-section-author .form-section -->', 'email' => '<p class="comment-form-email">' . '<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30" tabindex="2"' . $aria_req . ' />' . '<label for="email">' . esc_attr(gsc_get_option('genesis_comment_form_args_fields_email_label')) . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '</p><!-- #form-section-email .form-section -->', 'url' => '<p class="comment-form-url">' . '<input id="url" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" tabindex="3" />' . '<label for="url">' . esc_attr(gsc_get_option('genesis_comment_form_args_fields_url_label')) . '</label>' . '</p><!-- #form-section-url .form-section -->'), 'comment_field' => '<p class="comment-form-comment">' . '<textarea id="comment" name="comment" cols="45" rows="8" tabindex="4" aria-required="true"></textarea>' . '</p><!-- #form-section-comment .form-section -->', 'title_reply' => gsc_get_option('genesis_comment_form_args_title_reply'), 'comment_notes_before' => gsc_get_option('genesis_comment_form_args_comment_notes_before'), 'comment_notes_after' => gsc_get_option('genesis_comment_form_args_comment_notes_after'), 'label_submit' => esc_attr(gsc_get_option('genesis_comment_form_args_label_submit')));
    $args['fields']['author'] = gsc_get_option('genesis_comment_form_args_fields_author_display') ? $args['fields']['author'] : '';
    $args['fields']['email'] = gsc_get_option('genesis_comment_form_args_fields_email_display') ? $args['fields']['email'] : '';
    $args['fields']['url'] = gsc_get_option('genesis_comment_form_args_fields_url_display') ? $args['fields']['url'] : '';
    return $args;
}
function gmdl_mdl_comment_form($args)
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $args['fields']['author'] = '<p class="comment-form-author mdl-textfield mdl-js-textfield mdl-textfield--floating-label"><input id="author" class="mdl-textfield__input" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /><label class="mdl-textfield__label" for="author">' . __('Name', 'genesis-material-design-lite-child-theme') . ($req ? '<span class="required">*</span>' : '') . '</label> </p>';
    $args['fields']['email'] = '<p class="comment-form-email mdl-textfield mdl-js-textfield mdl-textfield--floating-label"><input id="email" class="mdl-textfield__input" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /><label class="mdl-textfield__label" for="email">' . __('Email', 'genesis-material-design-lite-child-theme') . ($req ? '<span class="required">*</span>' : '') . '</label></p>';
    $args['fields']['url'] = '<p class="comment-form-url mdl-textfield mdl-js-textfield mdl-textfield--floating-label"><input id="url" class="mdl-textfield__input" name="url" type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" /><label class="mdl-textfield__label" for="url">' . __('Website', 'genesis-material-design-lite-child-theme') . '</label></p>';
    $args['comment_field'] = '<p class="comment-form-comment mdl-textfield mdl-js-textfield"><textarea id="comment" class="mdl-textfield__input" name="comment" cols="45" rows="8" aria-required="true"></textarea><label class="mdl-textfield__label" for="comment">' . _x('Comment', 'genesis-material-design-lite-child-theme') . '</label></p>';
    return $args;
}
示例#28
0
function converio_comment_form_args()
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $comment_notes_before = '<p class="comment-notes">' . esc_attr__('Your email address will not be published.', 'converio') . '</p>';
    $comment_notes_after = '';
    $fields = array('author' => '<ul><li><label for="author">' . esc_attr__('Name', 'converio') . ($req ? ' <span class="required">*</span>' : '') . '</label><input id="author" name="author"' . $aria_req . ' value="' . esc_attr($commenter['comment_author']) . '"></li>', 'email' => '<li><label for="email">' . esc_attr__('Email', 'converio') . ($req ? ' <span class="required">*</span>' : '') . '</label><input id="email" name="email"' . $aria_req . ' value="' . esc_attr($commenter['comment_author_email']) . '"></li>', 'url' => '<li><label for="url">' . esc_attr__('Website', 'converio') . '</label><input id="url" name="url"' . $aria_req . ' value="' . esc_url($commenter['comment_author_url']) . '"></li></ul>');
    $comment_field = '<label for="comment">' . esc_attr__('Comment', 'converio') . '</label><textarea name="comment" id="comment" rows="8" cols="50"></textarea>';
    return array('comment_notes_before' => $comment_notes_before, 'comment_notes_after' => $comment_notes_after, 'fields' => $fields, 'comment_field' => $comment_field);
}
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;
}
示例#30
0
function theme_comment_form()
{
    $commenter = wp_get_current_commenter();
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $fields = array('author' => '<div class="field half-field">' . '<input class="' . ($req ? 'required' : '') . '" ' . ($req ? 'required' : '') . '  type="text" id="author" name="author" placeholder="Nombre" value="' . '" /></div>', 'email' => '<div class="field half-field">' . '<input class="' . ($req ? 'required' : '') . '" ' . ($req ? 'required' : '') . '  type="text" id="email" name="email" placeholder="E-mail" value="' . '" /></div>');
    $comment_field = '<div class="field">' . '<textarea class="' . ($req ? 'required' : '') . '" ' . ($req ? 'required' : '') . 'id="comment" name="comment" placeholder="Comentario" ></textarea></div>';
    $comment_notes_before = '';
    $comment_notes_after = '';
    $comments_args = array('fields' => $fields, '$logged_in_as' => $logged_in_as, 'comment_notes_before' => $comment_notes_before, 'comment_notes_after' => $comment_notes_after, 'comment_field' => $comment_field, 'title_reply' => 'Publicar comentario', 'label_submit' => 'Enviar');
    comment_form($comments_args);
}