Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58207 closed enhancement (fixed)

Code Modernization/Performance optimization: Replace `dirname(__FILE__)` with `__DIR__`

Reported by: hztyfoon Owned by: SergeyBiryukov
Priority: normal Milestone: 6.3
Component: General Version:
Severity: normal Keywords: has-patch
Cc: Focuses: performance, coding-standards

Description

Change History (4)

This ticket was mentioned in ​PR #4387 on ​WordPress/wordpress-develop by ​@rudlinkon.


3 years ago
#1

  • Keywords has-patch added

#2 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review → 6.3

#3 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 55691:

Coding Standards: Use __DIR__ magic constant in wp-admin/options-privacy.php.

This replaces the only remaining instance of dirname( __FILE__ ) in core to avoid the performance overhead of a function call.

Follow-up to [47198], [50161], [50631].

Props hztyfoon, rudlinkon.
Fixes #58207.

​@SergeyBiryukov commented on ​PR #4387:


3 years ago
#4

Thanks for the PR! Merged in r55691.

Note: See TracTickets for help on using tickets.