Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#25177 closed defect (bug) (fixed)

map_meta_cap() doesn't require $post_author_data

Reported by: duck_'s profile duck_ Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 2.0
Component: Performance Keywords: has-patch commit
Focuses: Cc:

Description

map_meta_cap() sets up $post_author_data to check if a user is editing/deleting/reading their own post. However, the only piece of data required is the ID. To get this data we already have $post_author_id from $post->post_author or $user_id.

Related: [21563] for #21120 did some optimisations to avoid get_userdata()

Attachments (1)

25177.diff (1.6 KB) - added by duck_ 11 years ago.

Download all attachments as: .zip

Change History (4)

@duck_
11 years ago

#1 @duck_
11 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.7

#2 @nacin
11 years ago

Passes all existing tests.

#3 @nacin
11 years ago

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

In 25177:

Don't set up $post_author_data in map_meta_cap() as we don't need it.

props duck_.
fixes #25177.

Note: See TracTickets for help on using tickets.