Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/ms.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 `$echo` parameter to `$display_message` in `upload_is_user_over_quota()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53203 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2022-04-18 10:31:40 +00:00
parent 24d9f5a568
commit a67c03172a

View File

@ -217,10 +217,11 @@ function wpmu_delete_user( $id ) {
*
* @since MU (3.0.0)
*
* @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
* @param bool $display_message Optional. If set to true and the quota is exceeded,
* a warning message is displayed. Default true.
* @return bool True if user is over upload space quota, otherwise false.
*/
function upload_is_user_over_quota( $echo = true ) {
function upload_is_user_over_quota( $display_message = true ) {
if ( get_site_option( 'upload_space_check_disabled' ) ) {
return false;
}
@ -232,7 +233,7 @@ function upload_is_user_over_quota( $echo = true ) {
$space_used = get_space_used();
if ( ( $space_allowed - $space_used ) < 0 ) {
if ( $echo ) {
if ( $display_message ) {
printf(
/* translators: %s: Allowed space allocation. */
__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),