WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 23 months ago

#24199 closed enhancement (fixed)

Redundant post ID validation

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

Description

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 2 years ago.

Download all attachments as: .zip

Change History (3)

@SergeyBiryukov2 years ago

comment:2 @ryan23 months 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.