WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#11631 closed enhancement (worksforme)

php code improvements get_the_title() and get_post()

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Optimization Keywords: has-patch
Focuses: Cc:

Description

php code improvements get_the_title() and get_post(). done some cleanup while looking into other areas.

Attachments (3)

11631-code-improvements.patch (5.5 KB) - added by hakre 5 years ago.
11631-code-improvements.2.patch (5.7 KB) - added by hakre 5 years ago.
Removed duplicate code
11631-code-improvements.3.patch (5.6 KB) - added by hakre 5 years ago.
Removed duplicate code (again); Better helper function name.

Download all attachments as: .zip

Change History (7)

hakre5 years ago

Removed duplicate code

hakre5 years ago

Removed duplicate code (again); Better helper function name.

comment:1 hakre5 years ago

  • Keywords dev-feedback added

comment:2 Denis-de-Bernardy5 years ago

  • Component changed from General to Optimization
  • Keywords dev-feedback removed
  • Milestone changed from Unassigned to 3.0

in the 3rd patch, you need to clone the post in the event it's not using the raw filter.

comment:3 nacin4 years ago

The stuff in get_the_title() does not appear to be code improvements in any way. We're making more variable assignments we don't need to be doing, and new isset() checks, and we're calling is_admin() twice now, and we're now checking for $format. Sure, it looks more compact, but that's not what we're going for.

Same with get_post(), though less so. None of this seems necessary.

comment:4 nacin4 years ago

  • Milestone 3.0 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Reopen > 3.0 if there are improvements we can work in.

Note: See TracTickets for help on using tickets.