Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#58207 closed enhancement (fixed)

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

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

Description

Change History (4)

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


18 months ago
#1

  • Keywords has-patch added

#2 @SergeyBiryukov
18 months ago

  • Milestone changed from Awaiting Review to 6.3

#3 @SergeyBiryukov
18 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to 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:


18 months ago
#4

Thanks for the PR! Merged in r55691.

Note: See TracTickets for help on using tickets.