Make WordPress Core

Changeset 60417 for trunk


Ignore:
Timestamp:
07/06/2025 04:40:53 PM (13 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Remove redundant check in WP_Upgrader:maintenance_mode().

The first part of the conditional checks if $enable is truthy, so it is always false in the elseif.

Follow-up to [11005].

Props justlevine.
See #63268.

File:
1 edited

Legend:

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

    r60216 r60417  
    10231023
    10241024                $file = $wp_filesystem->abspath() . '.maintenance';
     1025
    10251026                if ( $enable ) {
    10261027                        if ( ! wp_doing_cron() ) {
    10271028                                $this->skin->feedback( 'maintenance_start' );
    10281029                        }
     1030
    10291031                        // Create maintenance file to signal that we are upgrading.
    10301032                        $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
    10311033                        $wp_filesystem->delete( $file );
    10321034                        $wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
    1033                 } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
     1035                } elseif ( $wp_filesystem->exists( $file ) ) {
    10341036                        if ( ! wp_doing_cron() ) {
    10351037                                $this->skin->feedback( 'maintenance_end' );
    10361038                        }
     1039
    10371040                        $wp_filesystem->delete( $file );
    10381041                }
Note: See TracChangeset for help on using the changeset viewer.