Make WordPress Core


Ignore:
Timestamp:
03/03/2020 12:27:52 AM (4 years ago)
Author:
johnbillion
Message:

Upgrade/Install: Improved inline docs for the plugin and theme updater maintenance mode functionality.

Props bookdude13

See #49400

File:
1 edited

Legend:

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

    r47219 r47409  
    529529     * @since 2.8.0
    530530     *
    531      * @param bool|WP_Error  $return
    532      * @param array          $theme
    533      * @return bool|WP_Error
     531     * @param bool|WP_Error $return Upgrade offer return.
     532     * @param array         $theme Theme arguments.
     533     * @return bool|WP_Error The passed in $return param or WP_Error.
    534534     */
    535535    public function current_before( $return, $theme ) {
     
    540540        $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
    541541
    542         if ( get_stylesheet() !== $theme ) { // If not current.
     542        // Only run if current theme
     543        if ( get_stylesheet() !== $theme ) {
    543544            return $return;
    544545        }
    545546
    546         // Change to maintenance mode now.
     547        // Change to maintenance mode. Bulk edit handles this separately.
    547548        if ( ! $this->bulk ) {
    548549            $this->maintenance_mode( true );
     
    560561     * @since 2.8.0
    561562     *
    562      * @param bool|WP_Error  $return
    563      * @param array          $theme
    564      * @return bool|WP_Error
     563     * @param bool|WP_Error $return Upgrade offer return.
     564     * @param array         $theme Theme arguments.
     565     * @return bool|WP_Error The passed in $return param or WP_Error.
    565566     */
    566567    public function current_after( $return, $theme ) {
     
    571572        $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
    572573
    573         if ( get_stylesheet() !== $theme ) { // If not current.
     574        // Only run if current theme
     575        if ( get_stylesheet() !== $theme ) {
    574576            return $return;
    575577        }
     
    582584        }
    583585
    584         // Time to remove maintenance mode.
     586        // Time to remove maintenance mode. Bulk edit handles this separately.
    585587        if ( ! $this->bulk ) {
    586588            $this->maintenance_mode( false );
Note: See TracChangeset for help on using the changeset viewer.