From f2367e643bf3c4bb634524b1e59a19145b947ccb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 1 Mar 2021 10:36:29 +0000 Subject: [PATCH] Docs: Clarify a comment about `wp_opcache_invalidate()` in `_copy_dir()`. Follow-up to [48160]. See #52628. git-svn-id: https://develop.svn.wordpress.org/trunk@50460 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/update-core.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index bbf233eb70..6d9d243ddd 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -937,7 +937,7 @@ function update_core( $from, $to ) { * Import $wp_version, $required_php_version, and $required_mysql_version from the new version. * DO NOT globalise any variables imported from `version-current.php` in this function. * - * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8 + * BC Note: $wp_filesystem->wp_content_dir() returned unslashed pre-2.8. */ $versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php'; if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) { @@ -1373,7 +1373,10 @@ function _copy_dir( $from, $to, $skip_list = array() ) { } } - // `wp_opcache_invalidate()` only exists in WordPress 5.5, so don't run it when upgrading to 5.5. + /* + * `wp_opcache_invalidate()` only exists in WordPress 5.5 or later, + * so don't run it when upgrading from older versions. + */ if ( function_exists( 'wp_opcache_invalidate' ) ) { wp_opcache_invalidate( $to . $filename ); }