comment_form() does not pass post_id argument onto comments_open() (2 posts)

  1. PlywoodMillionaire
    Posted 5 years ago #

    I noticed today that comment_form() does not pass the $post_id argument onto comments_open() on line 1550 of comment-template.php. This presents a challenge when one wants to, for whatever reason, display a comment_form() outside of post context (or, perhaps in their own post context).

    By simply passing $post_id to comments_open() the form will display correctly.

    Comments read:

    @param mixed $post_id Post ID to generate the form for, uses the current post if null

    In fact, the form will _only_ generate if there is a current post.

    Curious to know your thoughts on this.

  2. pascoedj
    Posted 5 years ago #

    well my thoughts are that I'm confused about how to solve this !

Topic Closed

This topic has been closed to new replies.

About this Topic