function thematic_commentmeta($print = TRUE)
 {
     $content = '<div class="comment-meta">' . sprintf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'thematic'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
     if (get_edit_comment_link()) {
         $content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s" title="%2$s">%3$s</a></span>', get_edit_comment_link(), __('Edit comment'), __('Edit', 'thematic'));
     }
     $content .= '</div>' . "\n";
     return $print ? print apply_filters('thematic_commentmeta', $content) : apply_filters('thematic_commentmeta', $content);
 }
 /**
  * Create comment meta
  * 
  * Located in discussion.php
  * 
  * Override: childtheme_override_commentmeta <br>
  * Filter: cleanyetibasic_commentmeta
  */
 function cleanyetibasic_commentmeta($print = TRUE)
 {
     $content = '<div class="comment-meta">' . sprintf(_x('Posted %s at %s', 'Posted {$date} at {$time}', 'cleanyetibasic'), get_comment_date(), get_comment_time());
     $content .= ' <span class="meta-sep">|</span> ' . sprintf('<a href="%1$s" title="%2$s">%3$s</a>', '#comment-' . get_comment_ID(), __('Permalink to this comment', 'cleanyetibasic'), __('Permalink', 'cleanyetibasic'));
     if (get_edit_comment_link()) {
         $content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s" title="%2$s">%3$s</a></span>', get_edit_comment_link(), __('Edit comment', 'cleanyetibasic'), __('Edit', 'cleanyetibasic'));
     }
     $content .= '</div>' . "\n";
     return $print ? print apply_filters('cleanyetibasic_commentmeta', $content) : apply_filters('cleanyetibasic_commentmeta', $content);
 }
Example #3
0
 /**
  * Alias simply isn't enough for edit_comment_link()
  * @param string $link
  * @param type $id
  * @param string $before
  * @param string $after
  * @return string HTML link
  */
 public static function editCommentLink($link = null, $id, $before = '', $after = '')
 {
     if (!current_user_can('edit_comment', $id)) {
         return;
     }
     if (is_null($link)) {
         $link = __('Edit This', 'ait');
     }
     $link = '<a class="comment-edit-link" href="' . get_edit_comment_link($id) . '" title="' . esc_attr__('Edit comment') . '">' . $link . '</a>';
     echo $before . apply_filters('edit_comment_link', $link, $id) . $after;
 }
Example #4
0
    function st_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'comment':
                global $st_Settings;
                ?>

						<li id="comment-<?php 
                comment_ID();
                ?>
" class="comment">
	
							<?php 
                $avatar_size = '0' != $comment->comment_parent ? 50 : 75;
                $comment_author = get_the_author_meta('user_email') == $comment->comment_author_email ? ' bypostauthor' : '';
                $comment_level = '0' == $comment->comment_parent ? ' class="comment-holder comment-top-level' . $comment_author . '"' : ' class="comment-holder comment-low-level' . $comment_author . '"';
                $out = '<div' . $comment_level . '>';
                // Gravatar
                $out .= '<div class="avatar-box">' . get_avatar($comment, $avatar_size) . '</div>';
                $out .= '<div class="comment-box">';
                // Author name
                $out .= '<div class="comment-author" id="author-' . get_comment_ID() . '">' . get_comment_author_link() . '</div>';
                // Date
                $out .= '<div class="comment-date">';
                if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) {
                    $out .= st_niceTime(get_comment_date('c', get_comment_ID()));
                } else {
                    $out .= get_comment_date() . ' ' . __('at', 'strictthemes') . ' ' . get_comment_time();
                }
                $out .= '</div>';
                // Comment
                $out .= wpautop(get_comment_text());
                if (comments_open()) {
                    // Reply/Cancel links
                    $out .= '<span class="reply non-selectable">' . '<a title="' . get_comment_ID() . '" class="quick-reply" href="' . get_permalink() . '?replytocom=' . get_comment_ID() . '#respond">' . __('Reply', 'strictthemes') . '</a>' . '<a class="quick-reply-cancel none" href="#">' . __('Cancel', 'strictthemes') . '</a>' . '</span>';
                }
                // Edit link
                if (current_user_can('manage_options')) {
                    $out .= ' - <a href="' . get_edit_comment_link() . '">' . __('Edit', 'strictthemes') . '</a>';
                }
                // Pre-moderation
                if ($comment->comment_approved == '0') {
                    $out .= '<p><em class="comment-awaiting-moderation">' . __('Your comment is awaiting moderation.', 'strictthemes') . '</em></p>';
                }
                $out .= '<div class="quick-holder" id="quick-holder-' . get_comment_ID() . '"></div></div><div class="clear"><!-- --></div>';
                // .comment-box
                $out .= '</div>';
                // .$comment_level
                $out .= '<div class="clear"><!-- --></div>';
                echo $out;
                break;
        }
    }
 /**
  * Create comment meta
  * 
  * Located in discussion.php
  * 
  * Override: childtheme_override_commentmeta <br>
  * Filter: thematic_commentmeta
  */
 function thematic_commentmeta($print = true)
 {
     $content = '<div class="comment-meta">';
     $content .= '<time datetime="' . get_comment_time('c') . '">';
     $content .= sprintf(_x('Posted %s at %s', 'Posted {$date} at {$time}', 'thematic'), get_comment_date(), get_comment_time());
     $content .= '</time>';
     $content .= ' <span class="meta-sep">|</span> ' . sprintf('<a href="%1$s">%2$s</a>', '#comment-' . get_comment_ID(), __('Permalink', 'thematic'));
     if (get_edit_comment_link()) {
         $content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s">%2$s</a></span>', get_edit_comment_link(), __('Edit', 'thematic'));
     }
     $content .= '</div>' . "\n";
     return $print ? print apply_filters('thematic_commentmeta', $content) : apply_filters('thematic_commentmeta', $content);
 }
Example #6
0
    function st_pingback($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'pingback':
                global $st_Settings;
                ?>

						<li id="comment-<?php 
                comment_ID();
                ?>
" class="pingback">
	
							<?php 
                $out = '<div class="pingback-holder">';
                $out .= '<div class="pingback-box">';
                // Title
                $out .= '<div class="pingback-author" id="author-' . get_comment_ID() . '">' . get_comment_author_link();
                // Edit link
                if (current_user_can('manage_options')) {
                    $out .= ' - <a href="' . get_edit_comment_link() . '"><small>' . __('Edit', 'strictthemes') . '</small></a>';
                }
                $out .= '</div>';
                // Date
                $out .= '<div class="pingback-date">';
                if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) {
                    $out .= st_niceTime(get_comment_date('c', get_comment_ID()));
                } else {
                    $out .= get_comment_date() . ' ' . __('at', 'strictthemes') . ' ' . get_comment_time();
                }
                $out .= '</div>';
                $out .= '</div>';
                $out .= '<div class="clear"><!-- --></div>';
                echo $out;
                break;
        }
    }
    public function show_comment_html($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        $l10n_domain = $this->options->get('cgb_l10n_domain');
        $is_comment_from_other_page = get_the_ID() != $comment->comment_post_ID;
        $other_page_title = $is_comment_from_other_page ? get_the_title($comment->comment_post_ID) : '';
        $other_page_link = $is_comment_from_other_page ? '<a href="' . get_page_link($comment->comment_post_ID) . '">' . $other_page_title . '</a>' : '';
        switch ($comment->comment_type) {
            case 'pingback':
            case 'trackback':
                echo '
					<li class="post pingback">
					<p>' . __('Pingback:', $l10n_domain) . get_comment_author_link() . get_edit_comment_link(__('Edit', $l10n_domain), '<span class="edit-link">', '</span>') . '</p>';
                break;
            default:
                echo '
					<li ' . comment_class('', null, null, false) . ' id="li-comment-' . get_comment_ID() . '">
						<article id="comment-' . get_comment_ID() . '" class="comment">';
                eval('?>' . $this->options->get('cgb_comment_html'));
                echo '
						</article><!-- #comment-## -->';
                break;
        }
    }
Example #8
0
/**
 * Echo the comment links.
 *
 * @since 1.0.0
 */
function beans_comment_links()
{
    global $comment;
    echo beans_open_markup('beans_comment_links', 'ul', array('class' => 'tm-comment-links uk-subnav uk-subnav-line'));
    // Reply.
    echo get_comment_reply_link(array_merge($comment->args, array('add_below' => 'comment-content', 'depth' => $comment->depth, 'max_depth' => $comment->args['max_depth'], 'before' => beans_open_markup('beans_comment_item[_reply]', 'li'), 'after' => beans_close_markup('beans_comment_item[_reply]', 'li'))));
    // Edit.
    if (current_user_can('moderate_comments')) {
        echo beans_open_markup('beans_comment_item[_edit]', 'li');
        echo beans_open_markup('beans_comment_item_link[_edit]', 'a', array('href' => esc_url(get_edit_comment_link($comment->comment_ID))));
        echo beans_output('beans_comment_edit_text', __('Edit', 'tm-beans'));
        echo beans_close_markup('beans_comment_item_link[_edit]', 'a');
        echo beans_close_markup('beans_comment_item[_edit]', 'li');
    }
    // Link.
    echo beans_open_markup('beans_comment_item[_link]', 'li');
    echo beans_open_markup('beans_comment_item_link[_link]', 'a', array('href' => esc_url(get_comment_link($comment->comment_ID))));
    echo beans_output('beans_comment_link_text', __('Link', 'tm-beans'));
    echo beans_close_markup('beans_comment_item_link[_link]', 'a');
    echo beans_close_markup('beans_comment_item[_link]', 'li');
    echo beans_close_markup('beans_comment_links', 'ul');
}
    /**
     * Template for comments and pingbacks.
     *
     *
     * Used as a callback by wp_list_comments() for displaying the comments.
     *  Inspired from Twenty Twelve 1.0
     * @package Customizr
     * @since Customizr 1.0 
     */
    function tc_comment_callback($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        //get user defined max comment depth
        $max_comments_depth = get_option('thread_comments_depth');
        $max_comments_depth = isset($max_comments_depth) ? $max_comments_depth : 5;
        ob_start();
        switch ($comment->comment_type) {
            case 'pingback':
            case 'trackback':
                // Display trackbacks differently than normal comments.
                ?>
      <li <?php 
                comment_class();
                ?>
 id="comment-<?php 
                comment_ID();
                ?>
">
        <article id="comment-<?php 
                comment_ID();
                ?>
" class="comment">
          <p><?php 
                _e('Pingback:', 'customizr');
                ?>
 <?php 
                comment_author_link();
                ?>
 <?php 
                edit_comment_link(__('(Edit)', 'customizr'), '<span class="edit-link btn btn-success btn-mini">', '</span>');
                ?>
</p>
        </article>
      <?php 
                break;
            default:
                // Proceed with normal comments.
                global $post;
                ?>
      <li <?php 
                comment_class();
                ?>
 id="li-comment-<?php 
                comment_ID();
                ?>
">
        
          <?php 
                //when do we display the comment content?
                $tc_show_comment_content = 1 == get_option('thread_comments') && $depth < $max_comments_depth && comments_open();
                //gets the comment text => filter parameter!
                $comment_text = get_comment_text($comment->comment_ID, $args);
                printf('<article class="comment"><div class="%1$s"><div class="%2$s">%3$s</div><div class="%4$s">%5$s %6$s %7$s %8$s</div></div></article>', apply_filters('tc_comment_wrapper_class', 'row-fluid'), apply_filters('tc_comment_avatar_class', 'comment-avatar span2'), get_avatar($comment, apply_filters('tc_comment_avatar_size', 80)), apply_filters('tc_comment_content_class', 'span10'), $tc_show_comment_content ? sprintf('<div class="%1$s">%2$s</div>', apply_filters('tc_comment_reply_btn_class', 'reply btn btn-small'), get_comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'customizr') . ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'add_below' => apply_filters('tc_comment_reply_below', 'li-comment'))))) : '', sprintf('<header class="comment-meta comment-author vcard">%1$s %2$s</header>', sprintf('<cite class="fn">%1$s %2$s %3$s</cite>', get_comment_author_link(), $comment->user_id === $post->post_author ? '<span> ' . __('Post author', 'customizr') . '</span>' : '', current_user_can('edit_comment', $comment->comment_ID) ? '<p class="edit-link btn btn-success btn-mini"><a class="comment-edit-link" href="' . get_edit_comment_link($comment->comment_ID) . '">' . __('Edit', 'customizr') . '</a></p>' : ''), sprintf('<a class="comment-date" href="%1$s"><time datetime="%2$s">%3$s</time></a>', esc_url(get_comment_link($comment->comment_ID)), get_comment_time('c'), sprintf(__('%1$s at %2$s', 'customizr'), get_comment_date(), get_comment_time()))), '0' == $comment->comment_approved ? sprintf('<p class="comment-awaiting-moderation">%1$s</p>', __('Your comment is awaiting moderation.', 'customizr')) : '', sprintf('<section class="comment-content comment">%1$s</section>', apply_filters('comment_text', $comment_text, $comment, $args)));
                //end printf
                ?>
        <!-- #comment-## -->
      <?php 
                break;
        }
        // end comment_type check
        $html = ob_get_contents();
        if ($html) {
            ob_end_clean();
        }
        echo apply_filters('tc_comment_callback', $html, $comment, $args, $depth, $max_comments_depth);
    }
Example #10
0
 /**
  * {@inheritdoc }
  */
 public function get_object_link($object_id)
 {
     $comment = get_comment($object_id);
     return sprintf('<a href="%s">Comment #%d</a>', get_edit_comment_link($object_id), $object_id);
 }
    /**
     * hooked to bsocial_comments_manage_links outputs manage UI for a comment
     */
    public function manage_links($comment)
    {
        ?>
		<li class="approve-link"><?php 
        echo wp_kses_post($this->get_status_link($comment->comment_ID, 'approve'));
        ?>
</li>
		<li class="feature-link"><?php 
        echo wp_kses_post($this->featured_comments()->get_feature_link($comment->comment_ID));
        ?>
</li>
		<li class="edit-link">
			<a class="comment-edit-link" href="<?php 
        echo esc_url(get_edit_comment_link($comment->comment_ID));
        ?>
">Edit</a>
		</li>
		<li class="spam-link"><?php 
        echo wp_kses_post($this->get_status_link($comment->comment_ID, 'spam'));
        ?>
</li>
		<li class="trash-link"><?php 
        echo wp_kses_post($this->get_status_link($comment->comment_ID, 'trash'));
        ?>
</li>
		<?php 
    }
    /** START_EL */
    function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0)
    {
        $depth++;
        $GLOBALS['comment_depth'] = $depth;
        $GLOBALS['comment'] = $comment;
        global $post;
        ?>

		<li <?php 
        comment_class();
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">
			<span class="comment-avatar <?php 
        echo $comment->user_id === $post->post_author ? 'thumbnail' : '';
        ?>
">
				<?php 
        if ($comment->user_id === $post->post_author) {
            echo get_avatar($comment, 54);
        } else {
            echo get_avatar($comment, 64);
        }
        ?>
			</span>
			<div class="comment-body">
				<h4 class="comment-author vcard">
					<?php 
        printf('<cite>%1$s %2$s</cite>', get_comment_author_link(), $comment->user_id === $post->post_author ? '<span class="bypostauthor label label-primary"> ' . __('Post author', "toolset_starter") . '</span>' : '');
        ?>
				</h4>
				<?php 
        printf('<a href="%1$s"><time class="comment-date" datetime="%2$s">%3$s</time></a>', esc_url(get_comment_link($comment->comment_ID)), get_comment_time('c'), sprintf('%1$s ' . __('at', "toolset_starter") . ' %2$s', get_comment_date(), get_comment_time()));
        ?>

				<?php 
        if ('0' == $comment->comment_approved) {
            ?>
					<p class="alert alert-info comment-awaiting-moderation">
						<?php 
            _e('Your comment is awaiting moderation.', "toolset_starter");
            ?>
					</p>
				<?php 
        }
        ?>

				<div class="comment-content">
					<?php 
        comment_text();
        ?>
				</div>

				<div class="reply">
					<a class="btn btn-default btn-xs edit-link"
					   href="<?php 
        echo get_edit_comment_link();
        ?>
"><?php 
        _e('Edit', "toolset_starter");
        ?>
</a>
					<?php 
        comment_reply_link(array_merge($args, array('reply_text' => '<span class="btn btn-default btn-xs">' . __('Reply', "toolset_starter") . '</span>', 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
				</div>

				<?php 
        if (empty($args['has_children'])) {
            ?>
			</div>
			<?php 
        }
        ?>

			<?php 
    }
Example #13
0
    /** START_EL */
    function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0)
    {
        $depth++;
        $GLOBALS['comment_depth'] = $depth;
        $GLOBALS['comment'] = $comment;
        $parent_class = empty($args['has_children']) ? '' : 'parent';
        ?>
		
		<li <?php 
        comment_class($parent_class);
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">
			
			<div class="comment-c">
				
				<ul class="comment-meta">
					<li class="comment-author">
						<?php 
        echo get_comment_author_link();
        ?>
						<?php 
        //echo ( $args['avatar_size'] != 0 ? get_avatar( $comment, $args['avatar_size'] ) : '' );
        ?>
					</li>
					<li class="comment-date">
						<?php 
        comment_date();
        ?>
					</li>
					<li class="comment-time">
						 <?php 
        comment_time();
        ?>
					</li>
					<?php 
        if (get_edit_comment_link()) {
            ?>
						<li class="comment-edit">
							<?php 
            edit_comment_link('<span data-icon="edit"></span>');
            ?>
						</li>
					<?php 
        }
        ?>
					<li class="comment-reply">
						<?php 
        $reply_args = array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => '<span data-icon="reply-single"></span>');
        comment_reply_link(array_merge($args, $reply_args));
        ?>
					</li>
					<li class="comment-permalink">
						<a href="<?php 
        echo htmlspecialchars(get_comment_link(get_comment_ID()));
        ?>
"><span data-icon="link"></span></a>
					</li>
				</ul>

				<div class="comment-content">
					
					<?php 
        if (!$comment->comment_approved) {
            ?>
						<em class="comment-awaiting-moderation">Your comment is awaiting moderation.</em>
					
					<?php 
        } else {
            ?>
						<?php 
            comment_text();
            ?>
						
					<?php 
        }
        ?>
				</div>
				
			</div>

	<?php 
    }
Example #14
0
/**
 * Display or retrieve edit comment link with formatting.
 *
 * @since 1.0.0
 *
 * @param string $link Optional. Anchor text.
 * @param string $before Optional. Display before edit link.
 * @param string $after Optional. Display after edit link.
 * @return string|null HTML content, if $echo is set to false.
 */
function edit_comment_link($link = null, $before = '', $after = '')
{
    global $comment;
    if (!current_user_can('edit_comment', $comment->comment_ID)) {
        return;
    }
    if (null === $link) {
        $link = __('Edit This');
    }
    $link = '<a class="comment-edit-link" href="' . get_edit_comment_link($comment->comment_ID) . '" title="' . esc_attr__('Edit comment') . '">' . $link . '</a>';
    echo $before . apply_filters('edit_comment_link', $link, $comment->comment_ID) . $after;
}
Example #15
0
    /**
     * Template for comments and pingbacks.
     *
     * To override this walker in a child theme without modifying the comments template
     * simply create your own bp_dtheme_blog_comments(), and that function will be used instead.
     *
     * Used as a callback by wp_list_comments() for displaying the comments.
     *
     * @param mixed $comment Comment record from database
     * @param array $args Arguments from wp_list_comments() call
     * @param int $depth Comment nesting level
     * @see wp_list_comments()
     * @since BuddyPress (1.2)
     */
    function bp_dtheme_blog_comments($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        if ('pingback' == $comment->comment_type) {
            return false;
        }
        if (1 == $depth) {
            $avatar_size = 50;
        } else {
            $avatar_size = 25;
        }
        ?>

	<li <?php 
        comment_class();
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">
		<div class="comment-avatar-box">
			<div class="avb">
				<a href="<?php 
        echo get_comment_author_url();
        ?>
" rel="nofollow">
					<?php 
        if ($comment->user_id) {
            ?>
						<?php 
            echo bp_core_fetch_avatar(array('item_id' => $comment->user_id, 'width' => $avatar_size, 'height' => $avatar_size, 'email' => $comment->comment_author_email));
            ?>
					<?php 
        } else {
            ?>
						<?php 
            echo get_avatar($comment, $avatar_size);
            ?>
					<?php 
        }
        ?>
				</a>
			</div>
		</div>

		<div class="comment-content">
			<div class="comment-meta">
				<p>
					<?php 
        /* translators: 1: comment author url, 2: comment author name, 3: comment permalink, 4: comment date/timestamp*/
        printf(__('<a href="%1$s" rel="nofollow">%2$s</a> said on <a href="%3$s"><span class="time-since">%4$s</span></a>', 'buddypress'), get_comment_author_url(), get_comment_author(), get_comment_link(), get_comment_date());
        ?>
				</p>
			</div>

			<div class="comment-entry">
				<?php 
        if ($comment->comment_approved == '0') {
            ?>
				 	<em class="moderate"><?php 
            _e('Your comment is awaiting moderation.', 'buddypress');
            ?>
</em>
				<?php 
        }
        ?>

				<?php 
        comment_text();
        ?>
			</div>

			<div class="comment-options">
					<?php 
        if (comments_open()) {
            ?>
						<?php 
            comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth']));
            ?>
					<?php 
        }
        ?>

					<?php 
        if (current_user_can('edit_comment', $comment->comment_ID)) {
            ?>
						<?php 
            printf('<a class="button comment-edit-link bp-secondary-action" href="%1$s" title="%2$s">%3$s</a> ', get_edit_comment_link($comment->comment_ID), esc_attr__('Edit comment', 'buddypress'), __('Edit', 'buddypress'));
            ?>
					<?php 
        }
        ?>

			</div>

		</div>

<?php 
    }
function mytheme_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
   <li>
    <article <?php 
    comment_class('media');
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
      <a class="pull-left" href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
">
        <?php 
    echo get_avatar($comment, $size = '64');
    ?>
      </a>
      <div class="media-body">
        <header class="comment-author vcard">
            
          <?php 
    printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link());
    ?>
          <time><?php 
    printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
    ?>
</time> 
          <span class="sharing-tools">
            <a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><i class="icon-link"></i></a>
            <span class='st_facebook_custom' st_url="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><i class="icon-facebook-sign"></i></span>
            <span class='st_twitter_custom' st_url="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><i class="icon-twitter-sign"></i></span>
            <span class='st_linkedin_custom' st_url="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><i class="icon-linkedin-sign"></i></span>
            <span class='st_email_custom' st_url="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><i class="icon-envelope"></i></span>   
          </span>
          <?php 
    my_edit_link(get_edit_comment_link(), __('Edit comment'));
    ?>
        </header>
        <?php 
    if ($comment->comment_approved == '0') {
        ?>
          <em><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em>
          <br />
        <?php 
    }
    ?>

        <?php 
    comment_text();
    ?>

        <nav>
          <?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => 'Reply <i class="icon-reply"></i>')));
    ?>
        </nav>
      </div>
    </article>
  <!-- </li> is added by wordpress automatically -->
<?php 
}
 public function column_description($item)
 {
     $return = $item->object_name;
     switch ($item->object_type) {
         case 'Post':
             $return = sprintf('<a href="%s">%s</a>', get_edit_post_link($item->object_id), $item->object_name);
             break;
         case 'Taxonomy':
             if (!empty($item->object_id)) {
                 $return = sprintf('<a href="%s">%s</a>', get_edit_term_link($item->object_id, $item->object_subtype), $item->object_name);
             }
             break;
         case 'Comments':
             if (!empty($item->object_id) && ($comment = get_comment($item->object_id))) {
                 $return = sprintf('<a href="%s">%s #%d</a>', get_edit_comment_link($item->object_id), $item->object_name, $item->object_id);
             }
             break;
         case 'Export':
             if ('all' === $item->object_name) {
                 $return = __('All', 'aryo-activity-log');
             } else {
                 $pt = get_post_type_object($item->object_name);
                 $return = !empty($pt->label) ? $pt->label : $item->object_name;
             }
             break;
         case 'Options':
         case 'Core':
             $return = __($item->object_name, 'aryo-activity-log');
             break;
     }
     $return = apply_filters('aal_table_list_column_description', $return, $item);
     return $return;
 }
Example #18
0
    function mars_theme_comment_style($comment, $args, $depth)
    {
        error_reporting(0);
        $GLOBALS['comment'] = $comment;
        extract($args, EXTR_SKIP);
        ?>
		<li class="comment">
			<div class="the-comment">
				<?php 
        if ('0' == $comment->comment_approved) {
            ?>
					<p class="comment-awaiting-moderation"><?php 
            _e('Your comment is awaiting moderation.', 'mars');
            ?>
</p>
				<?php 
        }
        ?>
				<div class="avatar"><?php 
        if ($args['avatar_size'] != 0) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>
</div>
				<div class="comment-content">
					<span class="author"><?php 
        print $comment->comment_author;
        ?>
 <small>il y a <?php 
        print human_time_diff(get_comment_time('U'), current_time('timestamp'));
        ?>
</small></span>
					<?php 
        comment_text();
        ?>
					<?php 
        comment_reply_link(array_merge($args, array('add_below' => null, 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => '<i class="fa fa-reply"></i> ' . __('Reply', 'mars'))));
        ?>
					<?php 
        if (current_user_can('add_users')) {
            ?>
					<a href="<?php 
            print get_edit_comment_link($comment->comment_ID);
            ?>
" class="edit"><i class="fa fa-edit"></i> <?php 
            _e('Edit', 'mars');
            ?>
</a>
					<?php 
        }
        ?>
				</div>
			</div>
		<?php 
    }
Example #19
0
/**
 * Output the event journal table
 *
 * @since	1.3.7
 * @global	obj		$mdjm_event			MDJM_Event class object
 * @global	bool	$mdjm_event_update	True if this event is being updated, false if new.
 * @param	int		$event_id			The event ID.
 * @return	str
 */
function mdjm_event_metabox_history_journal_table($event_id)
{
    global $mdjm_event, $mdjm_event_update;
    $journals = mdjm_get_journal_entries($event_id);
    $count = count($journals);
    $i = 0;
    ?>
	<div id="mdjm-event-journal-table">
    	<strong><?php 
    _e('Recent Journal Entries', 'mobile-dj-manager');
    ?>
</strong> 
        <table class="widefat mdjm_event_journal_table mdjm_form_fields">
        	<thead>
                <tr>
                	<th style="width: 20%"><?php 
    _e('Date', 'mobile-dj-manager');
    ?>
</th>
                    <th><?php 
    _e('Excerpt', 'mobile-dj-manager');
    ?>
</th>
                </tr>
            </thead>

			<tbody>
            	<?php 
    if ($journals) {
        ?>
                	<?php 
        foreach ($journals as $journal) {
            ?>
                        <tr>
                            <td><a href="<?php 
            echo get_edit_comment_link($journal->comment_ID);
            ?>
"><?php 
            echo date(mdjm_get_option('time_format') . ' ' . mdjm_get_option('short_date_format'), strtotime($journal->comment_date));
            ?>
</a></td>
                            <td><?php 
            echo substr($journal->comment_content, 0, 250);
            ?>
</td>
                        </tr>
						<?php 
            $i++;
            ?>
                        
                        <?php 
            if ($i >= 3) {
                break;
            }
            ?>
                        
                    <?php 
        }
        ?>
				<?php 
    } else {
        ?>
                <tr>
                    <td colspan="2"><?php 
        printf(__('There are no journal entries associated with this %s', 'mobile-dj-manager'), mdjm_get_label_singular(true));
        ?>
</td>
                </tr>
                <?php 
    }
    ?>

            </tbody>

			<?php 
    if ($journals) {
        ?>
                <tfoot>
                	<tr>
                    	<td colspan="2"><span class="description">(<?php 
        printf(__('Displaying the most recent %d entries of <a href="%s">%d total', 'mobile-dj-manager'), $count >= 3 ? 3 : $count, add_query_arg(array('p' => $event_id), admin_url('edit-comments.php?p=5636')), $count);
        ?>
)</span></td>
                    </tr>
                </tfoot>
            <?php 
    }
    ?>

        </table>
    </div>
	<?php 
}
Example #20
0
function p2_comments($comment, $args, $echo = true)
{
    $GLOBALS['comment'] = $comment;
    $depth = prologue_get_comment_depth(get_comment_ID());
    $comment_text = apply_filters('comment_text', $comment->comment_content);
    $comment_class = comment_class('', null, null, false);
    $comment_time = get_comment_time();
    $comment_date = get_comment_date();
    $id = get_comment_ID();
    $avatar = get_avatar($comment, 32);
    $author_link = get_comment_author_link();
    $reply_link = prologue_get_comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ', 'reply_text' => __('Reply', 'p2')), $comment->comment_ID, $comment->comment_post_ID);
    $can_edit = current_user_can('edit_post', $comment->comment_post_ID);
    $edit_comment_url = get_edit_comment_link($comment->comment_ID);
    $edit_link = $can_edit ? " | <a class='comment-edit-link' href='{$edit_comment_url}' title='" . esc_attr__('Edit comment', 'p2') . "'>" . __('Edit', 'p2') . "</a>" : '';
    $content_class = $can_edit ? 'commentcontent comment-edit' : 'commentcontent';
    $awaiting_message = $comment->comment_approved == '0' ? '<p><em>' . __('Your comment is awaiting moderation.', 'p2') . '</em></p>' : '';
    $permalink = esc_url(get_comment_link());
    $permalink_text = __('Permalink', 'p2');
    $date_time = p2_date_time_with_microformat('comment');
    $html = <<<HTML
<li {$comment_class} id="comment-{$id}">
\t\t{$avatar}
\t\t<h4>
\t\t\t\t{$author_link}
\t\t\t\t<span class="meta">
\t\t\t\t\t\t{$date_time}
\t\t\t\t\t\t<span class="actions"><a href="{$permalink}">{$permalink_text}</a> {$reply_link} {$edit_link}</span>
\t\t\t\t</span>
\t\t</h4>
\t\t<div class="{$content_class}" id="commentcontent-{$id}">
\t\t\t\t{$comment_text}
\t\t</div>
HTML;
    if (!is_single() && get_comment_type() != 'comment') {
        return false;
    }
    if ($echo) {
        echo $html;
    } else {
        return $html;
    }
}
Example #21
0
 private function scan_comments_finish()
 {
     $hooverResults = $this->hoover->getBaddies();
     if ($this->hoover->errorMsg) {
         wordfence::statusEndErr();
         throw new Exception($this->hoover->errorMsg);
     }
     $this->hoover->cleanup();
     $haveIssues = false;
     foreach ($hooverResults as $idString => $hresults) {
         $arr = explode('-', $idString);
         $blogID = $arr[0];
         $commentID = $arr[1];
         $uctype = ucfirst($this->scanData[$idString]['type']);
         $type = $this->scanData[$idString]['type'];
         foreach ($hresults as $result) {
             if ($result['badList'] == 'goog-malware-shavar') {
                 $shortMsg = "{$uctype} with author " . $this->scanData[$idString]['author'] . " contains a suspected malware URL.";
                 $longMsg = "This {$type} contains a suspected malware URL listed on Google's list of malware sites. The URL is: " . $result['URL'] . " - More info available at <a href=\"http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=" . urlencode($result['URL']) . "&client=googlechrome&hl=en-US\" target=\"_blank\">Google Safe Browsing diagnostic page</a>.";
             } else {
                 if ($result['badList'] == 'googpub-phish-shavar') {
                     $shortMsg = "{$uctype} contains a suspected phishing site URL.";
                     $longMsg = "This {$type} contains a URL that is a suspected phishing site that is currently listed on Google's list of known phishing sites. The URL is: " . $result['URL'];
                 } else {
                     //A list type that may be new and the plugin has not been upgraded yet.
                     continue;
                 }
             }
             if (is_multisite()) {
                 switch_to_blog($blogID);
             }
             $ignoreP = $idString;
             $ignoreC = $idString . '-' . $this->scanData[$idString]['contentMD5'];
             if ($this->addIssue('commentBadURL', 1, $ignoreP, $ignoreC, $shortMsg, $longMsg, array('commentID' => $commentID, 'badURL' => $result['URL'], 'author' => $this->scanData[$idString]['author'], 'type' => $type, 'uctype' => $uctype, 'editCommentLink' => get_edit_comment_link($commentID), 'commentDate' => $this->scanData[$idString]['date'], 'isMultisite' => $this->scanData[$idString]['isMultisite'], 'domain' => $this->scanData[$idString]['domain'], 'path' => $this->scanData[$idString]['path'], 'blog_id' => $blogID))) {
                 $haveIssues = true;
             }
             if (is_multisite()) {
                 restore_current_blog();
             }
         }
     }
     wordfence::statusEnd($this->statusIDX['comments'], $haveIssues);
 }
    /**
     * Get output for detailed log section
     */
    function getLogRowDetailsOutput($row)
    {
        $context = $row->context;
        $message_key = $context["_message_key"];
        $output = "";
        #print_r($row);exit;
        /*
        if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
        		if ( '0' == $commentdata['comment_approved'] ) { // comment not spam, but not auto-approved
        			wp_notify_moderator( $comment_ID );
        */
        /*if ( isset( $context["comment_approved"] ) && $context["comment_approved"] == '0' ) {
        			$output .= "<br>comment was automatically approved";
        		} else {
        			$output .= "<br>comment was not automatically approved";
        		}*/
        $comment_text = "";
        if (isset($context["comment_content"]) && $context["comment_content"]) {
            $comment_text = $context["comment_content"];
            $comment_text = wp_trim_words($comment_text, 20);
            $comment_text = wpautop($comment_text);
        }
        // Keys to show
        $arr_plugin_keys = array();
        $comment_type = isset($context["comment_type"]) ? $context["comment_type"] : "";
        switch ($comment_type) {
            case "trackback":
                $arr_plugin_keys = array("trackback_status" => _x("Status", "comments logger - detailed output comment status", "simple-history"), "trackback_author" => _x("Name", "comments logger - detailed output author", "simple-history"), "trackback_author_email" => _x("Email", "comments logger - detailed output email", "simple-history"), "trackback_content" => _x("Content", "comments logger - detailed output content", "simple-history"));
                break;
            case "pingback":
                $arr_plugin_keys = array("pingback_status" => _x("Status", "comments logger - detailed output comment status", "simple-history"), "pingback_author" => _x("Name", "comments logger - detailed output author", "simple-history"), "pingback_author_email" => _x("Email", "comments logger - detailed output email", "simple-history"), "pingback_content" => _x("Content", "comments logger - detailed output content", "simple-history"));
                break;
            case "comment":
            default:
                $arr_plugin_keys = array("comment_status" => _x("Status", "comments logger - detailed output comment status", "simple-history"), "comment_author" => _x("Name", "comments logger - detailed output author", "simple-history"), "comment_author_email" => _x("Email", "comments logger - detailed output email", "simple-history"), "comment_content" => _x("Comment", "comments logger - detailed output content", "simple-history"));
                break;
                //"comment_author_url" => _x("Author URL", "comments logger - detailed output author", "simple-history"),
                //"comment_author_IP" => _x("IP number", "comments logger - detailed output IP", "simple-history"),
        }
        $arr_plugin_keys = apply_filters("simple_history/comments_logger/row_details_plugin_info_keys", $arr_plugin_keys);
        // Start output of plugin meta data table
        $output .= "<table class='SimpleHistoryLogitem__keyValueTable'>";
        foreach ($arr_plugin_keys as $key => $desc) {
            switch ($key) {
                case "comment_content":
                case "trackback_content":
                case "pingback_content":
                    $desc_output = $comment_text;
                    break;
                case "comment_author":
                case "trackback_author":
                case "pingback_author":
                    $desc_output = "";
                    if (isset($context[$key])) {
                        $desc_output .= esc_html($context[$key]);
                    }
                    /*
                    if ( isset( $context["comment_author_email"] ) ) {
                    
                    	$gravatar_email = $context["comment_author_email"];
                    	$avatar = $this->simpleHistory->get_avatar( $gravatar_email, 14, "blank" );
                    	$desc_output .= "<span class='SimpleCommentsLogger__gravatar'>{$avatar}</span>";
                    
                    }
                    */
                    break;
                case "comment_status":
                case "trackback_status":
                case "pingback_status":
                    if (isset($context["comment_approved"])) {
                        if ($context["comment_approved"] === "spam") {
                            $desc_output = __("Spam", "simple-history");
                        } else {
                            if ($context["comment_approved"] == 1) {
                                $desc_output = __("Approved", "simple-history");
                            } else {
                                if ($context["comment_approved"] == 0) {
                                    $desc_output = __("Pending", "simple-history");
                                }
                            }
                        }
                    }
                    break;
                case "comment_type":
                case "trackback_type":
                case "pingback_type":
                    if (isset($context["comment_type"])) {
                        if ($context["comment_type"] === "trackback") {
                            $desc_output = __("Trackback", "simple-history");
                        } else {
                            if ($context["comment_type"] === "pingback") {
                                $desc_output = __("Pingback", "simple-history");
                            } else {
                                if ($context["comment_type"] === "comment") {
                                    $desc_output = __("Comment", "simple-history");
                                } else {
                                    $desc_output = "";
                                }
                            }
                        }
                    }
                    break;
                default:
                    if (isset($context[$key])) {
                        $desc_output = esc_html($context[$key]);
                    }
                    break;
            }
            // Skip empty rows
            if (empty($desc_output)) {
                continue;
            }
            $output .= sprintf('
				<tr>
					<td>%1$s</td>
					<td>%2$s</td>
				</tr>
				', esc_html($desc), $desc_output);
        }
        // Add link to edit comment
        $comment_ID = isset($context["comment_ID"]) && is_numeric($context["comment_ID"]) ? (int) $context["comment_ID"] : false;
        if ($comment_ID) {
            $comment = get_comment($comment_ID);
            if ($comment) {
                // http://site.local/wp/wp-admin/comment.php?action=editcomment&c=
                $edit_comment_link = get_edit_comment_link($comment_ID);
                // Edit link sometimes does not contain comment ID
                // Probably because comment has been removed or something
                // So only continue if link does not end with "=""
                if ($edit_comment_link && $edit_comment_link[strlen($edit_comment_link) - 1] !== "=") {
                    $output .= sprintf('
						<tr>
							<td></td>
							<td><a href="%2$s">%1$s</a></td>
						</tr>
						', _x("View/Edit", "comments logger - edit comment", "simple-history"), $edit_comment_link);
                }
            }
            // if comment
        }
        // if comment id
        // End table
        $output .= "</table>";
        return $output;
    }
Example #23
0
/**
 * Display or retrieve edit comment link with formatting.
 *
 * @since 1.0.0
 *
 * @param string $link Optional. Anchor text.
 * @param string $before Optional. Display before edit link.
 * @param string $after Optional. Display after edit link.
 * @return string|null HTML content, if $echo is set to false.
 */
function edit_comment_link($link = null, $before = '', $after = '')
{
    global $comment, $post;
    if ($post->post_type == 'page') {
        if (!current_user_can('edit_page', $post->ID)) {
            return;
        }
    } else {
        if (!current_user_can('edit_post', $post->ID)) {
            return;
        }
    }
    if (null === $link) {
        $link = __('Edit This');
    }
    $link = '<a class="comment-edit-link" href="' . get_edit_comment_link($comment->comment_ID) . '" title="' . __('Edit comment') . '">' . $link . '</a>';
    echo $before . apply_filters('edit_comment_link', $link, $comment->comment_ID) . $after;
}
Example #24
0
/**
 * Displays a comment's edit link to users that have the capability to edit the comment.
 *
 * @since 1.0
 * @access public
 * @return string
 */
function bon_comment_edit_link_shortcode($attr)
{
    global $comment;
    $edit_link = get_edit_comment_link($comment->comment_ID);
    if (!$edit_link) {
        return '';
    }
    $attr = shortcode_atts(array('before' => '', 'after' => ''), $attr);
    $link = '<a class="comment-edit-link" href="' . esc_url($edit_link) . '" title="' . sprintf(esc_attr__('Edit %1$s', 'bon'), $comment->comment_type) . '"><span class="edit">' . __('Edit', 'bon') . '</span></a>';
    $link = apply_filters('edit_comment_link', $link, $comment->comment_ID);
    return $attr['before'] . $link . $attr['after'];
}
Example #25
0
/**
 * Retrieve a link to edit the current comment, if the user is logged in and allowed to edit the comment.
 *
 * @since  4.0.4
 * @param  array  $args   Arguments.
 * @return string $output HTML-link to edit the current comment.
 */
function cherry_get_the_post_comment_link_edit($args)
{
    global $comment;
    $text = __('Edit', 'cherry');
    if (!empty($args['text'])) {
        $text = esc_attr($args['text']);
    }
    $url = get_edit_comment_link($comment->comment_ID);
    if (null === $url) {
        return;
    }
    $link = '<a class="comment-edit-link" href="' . esc_url($url) . '">' . $text . '</a>';
    /**
     * Filter the comment edit link anchor tag.
     *
     * @since 4.0.4
     * @param string $link       Anchor tag for the edit link.
     * @param int    $comment_id Comment ID.
     * @param array  $args       Arguments.
     */
    return apply_filters('cherry_get_the_post_comment_link_edit', $link, $comment->comment_ID, $args);
}
Example #26
0
                    }
                }
                ?>

	<li <?php 
                comment_class();
                ?>
 id="li-comment-<?php 
                comment_ID();
                ?>
">
		<div id="comment-<?php 
                comment_ID();
                ?>
" <?php 
                echo $classname;
                ?>
>
    
		<div class="comment-author vcard">
			<?php 
                echo get_user_avatar($comment->user_id, 45, $comment->comment_author_email);
                ?>

		</div><!-- .comment-author .vcard -->
         <div class="wpanswerstuff">
        <ul>
  
        <li>
        	<?php 
                $commentAuthID = get_user_meta($comment->user_id);
                $commentAuthName = $commentAuthID['facebookusername'][0];
                $commentAuthLink = "http://facebook.com/" . $commentAuthID['facebookuserid'][0];
                if ($commentAuthName == "") {
                    $commentAuthName = "Anonymous";
                }
                if ($commentAuthLink == "") {
                    $commentAuthLink = "#";
                }
                ?>
        	<!-- <span><?php 
                //print_r($commentAuthID)
                ?>
</span> -->
        	<a href="<?php 
                echo $commentAuthLink;
                ?>
" class="comment-name" target="_blank" ><?php 
                echo $commentAuthName;
                ?>
</a>
			<br/>
        	<a href="<?php 
                echo esc_url(get_comment_link($comment->comment_ID));
                ?>
">
			<?php 
                /* translators: 1: date, 2: time */
                printf(__('%1$s at %2$s', 'capiton'), get_comment_date(), get_comment_time());
                ?>
</a><?php 
                edit_comment_link(__('(Edit)', 'capiton'), ' ');
                ?>
</li>
        <?php 
                if ($hide_voting == 0) {
                    ?>
<li id="report_<?php 
                    echo $comment->comment_ID;
                    ?>
"><a href="#" class="reportme" commentid="<?php 
                    echo $comment->comment_ID;
                    ?>
">Report This Post</a></li><?php 
                }
                ?>

        <?php 
                if (current_user_can('moderate_comments') || is_user_logged_in() && $post->user_id == $user->ID) {
                    ?>

        <!-- <li><a href="#" class="bestanswer" commentid="<?php 
                    echo $comment->comment_ID;
                    ?>
">Select as Best Answer</a></li> -->
        <?php 
function edit_comment_link($link = 'Edit This', $before = '', $after = '')
{
    global $comment, $post;
    if ($post->post_type == 'attachment') {
    } elseif ($post->post_type == 'page') {
        if (!current_user_can('edit_page', $post->ID)) {
            return;
        }
    } else {
        if (!current_user_can('edit_post', $post->ID)) {
            return;
        }
    }
    $link = '<a href="' . get_edit_comment_link($comment->comment_ID) . '" title="' . __('Edit comment') . '">' . $link . '</a>';
    echo $before . apply_filters('edit_comment_link', $link, $comment->comment_ID) . $after;
}
Example #28
0
		function wm_comment( $comment, $args, $depth ) {
			$GLOBALS['comment'] = $comment;

			switch ( $comment->comment_type ) {
				case 'pingback' :
				case 'trackback' :

				?>
				<li class="pingback">
					<p>
						<strong><?php _e( 'Pingback:', 'lespaul_domain' ); ?></strong>
						<?php comment_author_link(); ?>
						<?php
						if ( get_edit_comment_link() )
							echo ' | <a href="' . get_edit_comment_link() . '" class="edit-link">' . __( 'Edit', 'lespaul_domain' ) . '</a>';
						?>

					</p>
				<?php

				break;
				default :

				?>
				<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
					<article class="comment-content">
							<div class="gravatar"><?php echo get_avatar( $comment, 180 ); ?></div>

							<div class="comment-heading">
								<strong class="author"><?php comment_author_link(); ?></strong><br />

								<a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>" class="published-on">
									<time datetime="<?php echo esc_attr( get_comment_date( 'c' ) ); ?>"><?php printf( __( '%1$s at %2$s', 'lespaul_domain' ), esc_html( get_comment_date() ), esc_html( get_comment_time() ) ); ?></time>
								</a>

								<?php
								if ( get_edit_comment_link() )
									echo ' | <a href="' . get_edit_comment_link() . '" class="comment-edit-link">' . __( 'Edit', 'lespaul_domain' ) . '</a>';

								comment_reply_link( array_merge( $args, array(
									'reply_text' => __( ' | Reply', 'lespaul_domain' ),
									'depth'      => $depth,
									'max_depth'  => $args['max_depth']
									) ) );
								?>
							</div> <!-- /comment-heading -->

							<div class="comment-text">
								<?php
								if ( '0' == $comment->comment_approved )
									echo '<p class="awaiting"><em>' . __( 'Your comment is awaiting moderation.', 'lespaul_domain' ) . '</em></p>';

								comment_text();
								?>
							</div>
					</article>
				<?php

				break;
			} // /switch
		}
Example #29
0
/**
 * Display edit comment link with formatting.
 *
 * @since 1.0.0
 *
 * @global object $comment
 *
 * @param string $text   Optional. Anchor text.
 * @param string $before Optional. Display before edit link.
 * @param string $after  Optional. Display after edit link.
 */
function edit_comment_link($text = null, $before = '', $after = '')
{
    global $comment;
    if (!current_user_can('edit_comment', $comment->comment_ID)) {
        return;
    }
    if (null === $text) {
        $text = __('Edit This');
    }
    $link = '<a class="comment-edit-link" href="' . get_edit_comment_link($comment->comment_ID) . '">' . $text . '</a>';
    /**
     * Filter the comment edit link anchor tag.
     *
     * @since 2.3.0
     *
     * @param string $link       Anchor tag for the edit link.
     * @param int    $comment_id Comment ID.
     * @param string $text       Anchor text.
     */
    echo $before . apply_filters('edit_comment_link', $link, $comment->comment_ID, $text) . $after;
}
<?php

foreach ($this->featured_comments as $comment_post) {
    ?>
	<div class="featured-comment" data-comment-id="<?php 
    echo absint($comment_post->comment->comment_ID);
    ?>
">
		<?php 
    echo $this->get_featured_comment_text($comment_post->comment->comment_ID);
    ?>
		 - <a href="<?php 
    echo get_edit_comment_link($comment_post->comment->comment_ID);
    ?>
" title="Edit">Edit</a>
		 | <a href="<?php 
    echo get_comment_link($comment_post->comment->comment_ID);
    ?>
" title="View">View</a>
		 | <?php 
    echo $this->get_feature_link($comment_post->comment->comment_ID);
    ?>
	</div>
	<?php 
}
// END foreach