Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24199 closed enhancement (fixed)

Redundant post ID validation

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: ryan's profile ryan
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.6
Component: General Keywords: has-patch
Focuses: Cc:


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.

Attachments (1)

24199.patch (3.4 KB) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (3)

#2 @ryan
11 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 24249:

Remove redundant post ID validation.

Props SergeyBiryukov
fixes #24199

Note: See TracTickets for help on using tickets.