WordPress.org

Forums

[resolved] Allow Comments on Future Posts in WP v3.x (5 posts)

  1. Rob Barrett
    Member
    Posted 4 years ago #

    I'm using future posts to display upcoming events, and I'd like visitors to be able to comment on these posts. However, I found out that commenting on future posts was excluded from WP v3 as it was deemed a bug.

    Unfortunately, the fix that is mentioned here is no longer valid, as the relevant lines no longer exist.

    Does anybody know how to reenable commenting on future posts? I'd be really grateful if someone could help with a fix.

    Thanks

  2. tgiokdi
    Member
    Posted 4 years ago #

    hah, I came here wondering who figured it previously, cause I updated the core files.

    this should be a plugin or option perhaps?

  3. tgiokdi
    Member
    Posted 4 years ago #

    ok, same game, it's just changed a little bit, go to line 40 in wp-comments-post.php and find this code:

    '} elseif ( !$status_obj->public && !$status_obj->private ) {
    do_action('comment_on_draft', $comment_post_ID);
    exit;'

    all I did was comment it out so it looks like this:
    '//} elseif ( !$status_obj->public && !$status_obj->private ) {
    // do_action('comment_on_draft', $comment_post_ID);
    // exit;'

    a quick save and upload and we're back to commenting on future posts.

  4. Rob Barrett
    Member
    Posted 4 years ago #

    Tgiokdi, sorry it's taken me a couple of weeks to get back to you - I've not had a chance to revisit that project until now.

    Anyway, I'm just replying to say thanks - that little edit does the job perfectly. Thanks so much for looking into it!

    Rob

  5. johnstonphilip
    Member
    Posted 3 years ago #

    Is there a good way to accomplish this without modifying core WP files? Maybe using a hook like comment_on_draft?

    I've been trying to find an alternative way to do it - any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic