Make WordPress Core


Ignore:
Timestamp:
09/11/2023 04:51:09 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Code Modernization: Use dirname() with the $levels parameter.

PHP 7.0 introduced the $levels parameter to the dirname() function, which means nested calls to dirname() are no longer needed.

Note: This is enforced by WPCS 3.0.0.

Reference: PHP Manual: dirname().

Follow-up to [56141].

Props jrf.
See #59161, #58831.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/theme.php

    r56245 r56552  
    157157 */
    158158function _get_template_edit_filename( $fullpath, $containingfolder ) {
    159     return str_replace( dirname( dirname( $containingfolder ) ), '', $fullpath );
     159    return str_replace( dirname( $containingfolder, 2 ), '', $fullpath );
    160160}
    161161
Note: See TracChangeset for help on using the changeset viewer.