Delayed commenting

We have a client who is using WP as part of an alternate reality game, and as part of it, they want to have ‘characters’ leave comments on posts at certain times. They basically want to be able to queue up comments in advance, so that they drop at the right time (similar to how you can control posts going live at a certain time.)

Is there a plugin that handles this?

Related posts

Leave a Reply

1 comment

  1. There isn’t a plugin that I know of. How many comments are we talking about? I’m assuming to many to manually approve.

    A simple solution I can think of would be adding something like this to the comment loop in comments.php. Find the foreach loop and replace it with something like

    <?php 
    //set the date one day into the future
    $date = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");
    foreach($comments as $comment) :
        if($date > comments->comment_date ){
                <?php comment_text(); ?>  
                <cite><?php comment_type(); ?> by <?php comment_author_link(); ?> on <?php comment_date(); ?> at <?php comment_time(); ?></cite>  }
    endforeach;
    ?>
    

    This is untested and just an example. You should be able to set $date to whatever you want or even use a random time.

    Resources:
    get_comments()
    Unraveling the Secrets of WordPress’ Comments.php File
    PHP Date add 1 hour