[wp-trac] [WordPress Trac] #40286: It appears to me that comments_open() is passing the wrong args to apply_filters
WordPress Trac
noreply at wordpress.org
Tue Mar 28 15:52:40 UTC 2017
#40286: It appears to me that comments_open() is passing the wrong args to
apply_filters
--------------------------+-----------------------------
Reporter: sringwood | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 4.7.3
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
The function comments_open() is passed one argument which may be null
($post_id) which is used to call get_post(). The function get_post() will
use the current post if $post_id is null.
The last line of the function comments_open() is
return apply_filters( 'comments_open', $open, $post_id );
Logically in the call it seems to me that $post_id (which may be null)
should be $_post->ID to reflect the post returned by the call get_post().
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40286>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list