• Resolved rubai

    (@rubai)


    For a new theme I am building I want to add this functionality. So when a user leaves a comment is goes for moderation. If is approved, it is displayed. Now when the use comments from the site, when they click on post comment the page refreshes. the comment ID is appended to the url. But I can’t see that comment because its under moderation. I want to display a message and the comment to the user saying that your comment is under moderation.

    I used a callback function for the wp_list_comments so that might be the case. The code is

    function erubai_comments( $comment, $args, $depth ) {
    	$GLOBALS['comment'] = $comment;
    	?>
    		<?php if ( $comment->comment_approved == '1' ): ?>
    		<li class="post-comment">
    			<article id="comment-<?php comment_ID() ?>" class="group">
    				<div class="vcard grid-1-5">
    					<?php echo get_avatar( $comment, 128 ); ?>
    				</div>
    				<div class="comment-content grid-4-5">
    					<h4 class="fn">
    						<?php comment_author_link() ?>
    					</h4>
    					<time>
    						<a href="#comment-<?php comment_ID() ?>" pubdate>
    							<?php comment_date() ?> at <?php comment_time() ?>
    						</a>
    					</time>
    
    					<?php comment_text(); ?>
    					<p><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?></p>
    				</div>
    			</article>
    		<?php endif;
    	}

    What might be the problem?

    Thanks in advance!!

  • The topic ‘Showing comments under moderation’ is closed to new replies.