From c41829ea95b1c7b5548d1cceb7dac90bdb761e4e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 11 Sep 2023 04:53:22 +0000 Subject: [PATCH] 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: [https://www.php.net/manual/en/function.dirname.php PHP Manual: dirname()]. Follow-up to [56141]. Props jrf. See #59161, #58831. Built from https://develop.svn.wordpress.org/trunk@56552 git-svn-id: http://core.svn.wordpress.org/trunk@56064 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 2 +- wp-admin/maint/repair.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index d98cb5de33..b0b3c6d768 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -156,7 +156,7 @@ function get_page_templates( $post = null, $post_type = 'page' ) { * @return string */ function _get_template_edit_filename( $fullpath, $containingfolder ) { - return str_replace( dirname( dirname( $containingfolder ) ), '', $fullpath ); + return str_replace( dirname( $containingfolder, 2 ), '', $fullpath ); } /** diff --git a/wp-admin/maint/repair.php b/wp-admin/maint/repair.php index 554e466d76..1c0f6ffa98 100644 --- a/wp-admin/maint/repair.php +++ b/wp-admin/maint/repair.php @@ -7,7 +7,7 @@ */ define( 'WP_REPAIRING', true ); -require_once dirname( dirname( __DIR__ ) ) . '/wp-load.php'; +require_once dirname( __DIR__, 2 ) . '/wp-load.php'; header( 'Content-Type: text/html; charset=utf-8' ); ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index b38c33e737..74209c6c94 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56551'; +$wp_version = '6.4-alpha-56552'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.