WordPress.org

Forums

Allow comments on drafts (9 posts)

  1. mannex
    Member
    Posted 8 years ago #

    Hello,

    I don't know why comments are not allowed on drafts, but for multi-author blogs it would be great to be able to do it. I've tried to edit wp-comments-post.php (http://trac.wordpress.org/browser/branches/1.5/wp-comments-post.php?rev=2842) but havn't managed to get it working.

    Any ideas?

  2. moshu
    Member
    Posted 8 years ago #

    Since drafts are not shown publicly... it just doesn't make sense.

  3. mannex
    Member
    Posted 8 years ago #

    As I said, for multi-author blogs it would be good. All authors can see all drafts. Clicking "View" from Edit posts is the best way to read another mans post. Once there, submitting a comment seems logical.

  4. Marcel Brinkkemper
    Member
    Posted 8 years ago #

    it would be good but does it make sense to make such an effort to go into source code?
    Why don't you use a category e.g. 'draft' which is not shown on the main page, with password protected posts?
    You share the password with other authors and when the post is ready to really-publish remove the password and change the category.

  5. mannex
    Member
    Posted 8 years ago #

    that would be one solution, but for the end user it just seems to be to much hazzle...

  6. mannex
    Member
    Posted 7 years ago #

    No one?

  7. aks2007
    Member
    Posted 7 years ago #

    I was able to do this by making the following change to wp-comments-post.php

    if ( empty($status->comment_status) ) {
    	do_action('comment_id_not_found', $comment_post_ID);
    	exit;
    } elseif ( 'closed' ==  $status->comment_status ) {
    	do_action('comment_closed', $comment_post_ID);
    	wp_die( __('Sorry, comments are closed for this item.') );
    // } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
    //	do_action('comment_on_draft', $comment_post_ID);
    //	exit;
    }

    Does that make sense?

  8. mannex
    Member
    Posted 7 years ago #

    Thanks, I will try it right away!

  9. mannex
    Member
    Posted 7 years ago #

    The comments get saved in the database but are not shown on the post or elsewere...

Topic Closed

This topic has been closed to new replies.

About this Topic