Make WordPress Core

Changeset 53203


Ignore:
Timestamp:
04/18/2022 10:31:40 AM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r53060 r53203  
    218218 * @since MU (3.0.0)
    219219 *
    220  * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
     220 * @param bool $display_message Optional. If set to true and the quota is exceeded,
     221 *                              a warning message is displayed. Default true.
    221222 * @return bool True if user is over upload space quota, otherwise false.
    222223 */
    223 function upload_is_user_over_quota( $echo = true ) {
     224function upload_is_user_over_quota( $display_message = true ) {
    224225    if ( get_site_option( 'upload_space_check_disabled' ) ) {
    225226        return false;
     
    233234
    234235    if ( ( $space_allowed - $space_used ) < 0 ) {
    235         if ( $echo ) {
     236        if ( $display_message ) {
    236237            printf(
    237238                /* translators: %s: Allowed space allocation. */
Note: See TracChangeset for help on using the changeset viewer.