[wp-trac] [WordPress Trac] #24199: Redundant post ID validation

WordPress Trac noreply at wordpress.org
Fri Apr 26 04:53:13 UTC 2013


#24199: Redundant post ID validation
----------------------------+-----------------------
 Reporter:  SergeyBiryukov  |      Owner:
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  3.6
Component:  General         |    Version:  trunk
 Severity:  normal          |   Keywords:  has-patch
----------------------------+-----------------------
 We have this in some of the recently introduced functions:
 {{{
 $post = empty( $post_id ) ? get_post() : get_post( $post_id );
 }}}
 That kind of validation is redundant, it duplicates the check in
 `get_post()`. We can just always call `get_post( $post_id )` instead.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24199>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list