Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19941 closed enhancement (fixed)

Post template: return string instead of setting then return

Reported by: niallkennedy's profile niallkennedy Owned by: nacin's profile nacin
Milestone: 3.4 Priority: normal
Severity: normal Version:
Component: Performance Keywords: has-patch
Focuses: Cc:

Description

In post template if a password is required to access the post a variable is currently set and the variable returned in the next line.

Return the result of get_the_password_form() instead of writing to a variable and immediately returning that variable.

Attachments (1)

post-template.diff (643 bytes) - added by niallkennedy 12 years ago.
return result of password form

Download all attachments as: .zip

Change History (5)

@niallkennedy
12 years ago

return result of password form

#1 @nacin
12 years ago

I wouldn't really call it "performance" but it is indeed good practice to not create a variable you only use once.

#2 @niallkennedy
12 years ago

  • Summary changed from Post template perf: return string instead of setting then return to Post template: return string instead of setting then return

#3 @nacin
12 years ago

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

In [19812]:

Don't create a variable we only use once. props niallkennedy, fixes #19941.

#4 @ocean90
12 years ago

  • Milestone changed from Awaiting Review to 3.4
Note: See TracTickets for help on using tickets.