From 91ad9dbb0703db2fa9bf9e14e5ff20304753d43d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 20 Apr 2022 10:46:09 +0000 Subject: [PATCH] Code Modernization: Rename parameters that use reserved keywords in `wp-admin/includes/upgrade.php`. While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names. This commit renames the `$public` parameter to `$is_public` in `wp_install()`. Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220]. Props jrf, aristath, poena, justinahinon, SergeyBiryukov. See #55327. Built from https://develop.svn.wordpress.org/trunk@53230 git-svn-id: http://core.svn.wordpress.org/trunk@52819 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 8 ++++---- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 5e48437434..82fda9682f 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -31,7 +31,7 @@ if ( ! function_exists( 'wp_install' ) ) : * @param string $blog_title Site title. * @param string $user_name User's username. * @param string $user_email User's email. - * @param bool $public Whether site is public. + * @param bool $is_public Whether the site is public. * @param string $deprecated Optional. Not used. * @param string $user_password Optional. User's chosen password. Default empty (random password). * @param string $language Optional. Language chosen. Default empty. @@ -44,7 +44,7 @@ if ( ! function_exists( 'wp_install' ) ) : * @type string $password_message The explanatory message regarding the password. * } */ - function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' ) { + function wp_install( $blog_title, $user_name, $user_email, $is_public, $deprecated = '', $user_password = '', $language = '' ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.6.0' ); } @@ -57,7 +57,7 @@ if ( ! function_exists( 'wp_install' ) ) : update_option( 'blogname', $blog_title ); update_option( 'admin_email', $user_email ); - update_option( 'blog_public', $public ); + update_option( 'blog_public', $is_public ); // Freshness of site - in the future, this could get more specific about actions taken, perhaps. update_option( 'fresh_site', 1 ); @@ -71,7 +71,7 @@ if ( ! function_exists( 'wp_install' ) ) : update_option( 'siteurl', $guessurl ); // If not a public site, don't ping. - if ( ! $public ) { + if ( ! $is_public ) { update_option( 'default_pingback_flag', 0 ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 95e9beddf0..58f58e976b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-beta2-53229'; +$wp_version = '6.0-beta2-53230'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.