[wp-trac] [WordPress Trac] #58207: Code Modernization/Performance optimization: Replace `dirname(__FILE__)` with `__DIR__`
WordPress Trac
noreply at wordpress.org
Thu Apr 27 13:12:25 UTC 2023
#58207: Code Modernization/Performance optimization: Replace `dirname(__FILE__)`
with `__DIR__`
-------------------------+--------------------------------------------
Reporter: hztyfoon | Owner: SergeyBiryukov
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.3
Component: General | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: performance, coding-standards
-------------------------+--------------------------------------------
Changes (by SergeyBiryukov):
* owner: (none) => SergeyBiryukov
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"55691" 55691]:
{{{
#!CommitTicketReference repository="" revision="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.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58207#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list