WordPress.org

Make WordPress Core

Ticket #25998: wp-admin_includes_update-core-php.diff

File wp-admin_includes_update-core-php.diff, 3.8 KB (added by JoshuaAbenazer, 7 years ago)
  • wp-admin/includes/update-core.php

     
    644644        @set_time_limit( 300 );
    645645
    646646        // Sanity check the unzipped distribution
     647        /**
     648         * Filter the real time feedback of update core processes.
     649         *
     650         * @since 2.5.0
     651         *
     652         * @param string $feedback The real time feedback of update core processes.
     653         */
    647654        apply_filters( 'update_feedback', __('Verifying the unpacked files…') );
    648655        $distro = '';
    649656        $roots = array( '/wordpress/', '/wordpress-mu/' );
     
    689696                return new WP_Error( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ) );
    690697        elseif ( !$mysql_compat )
    691698                return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) );
    692 
     699       
     700        /** This filter is documented in wp-admin/includes/update-core.php */
    693701        apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) );
    694702
    695703        // Don't copy wp-content, we'll deal with that below
     
    739747                                return new WP_Error( 'files_not_writable', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), implode( ', ', $error_data ) );
    740748                }
    741749        }
    742 
     750       
     751        /** This filter is documented in wp-admin/includes/update-core.php */
    743752        apply_filters( 'update_feedback', __( 'Enabling Maintenance mode…' ) );
    744753        // Create maintenance file to signal that we are upgrading
    745754        $maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
    746755        $maintenance_file = $to . '.maintenance';
    747756        $wp_filesystem->delete($maintenance_file);
    748757        $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE);
    749 
     758       
     759        /** This filter is documented in wp-admin/includes/update-core.php */
    750760        apply_filters( 'update_feedback', __( 'Copying the required files&#8230;' ) );
    751761        // Copy new versions of WP files into place.
    752762        $result = _copy_dir( $from . $distro, $to, $skip );
     
    811821                        }
    812822                }
    813823        }
    814 
     824       
     825        /** This filter is documented in wp-admin/includes/update-core.php */
    815826        apply_filters( 'update_feedback', __( 'Disabling Maintenance mode&#8230;' ) );
    816827        // Remove maintenance file, we're done with potential site-breaking changes
    817828        $wp_filesystem->delete( $maintenance_file );
     
    883894        }
    884895
    885896        // Upgrade DB with separate request
     897        /** This filter is documented in wp-admin/includes/update-core.php */
    886898        apply_filters('update_feedback', __('Upgrading database&#8230;'));
    887899        $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db');
    888900        wp_remote_post($db_upgrade_url, array('timeout' => 60));
     
    897909                delete_option('update_core');
    898910
    899911        // If we made it this far:
     912        /**
     913         * Fires once the WordPress core is updated successfully.
     914         *
     915         * @since 3.3.0
     916         *
     917         * @param string $wp_version The current WordPress version.
     918         */
    900919        do_action( '_core_updated_successfully', $wp_version );
    901920
    902921        // Clear the option that blocks auto updates after failures, now that we've been successful.
     
    10041023        include(ABSPATH . 'wp-admin/admin-footer.php');
    10051024        exit();
    10061025}
    1007 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
     1026add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' );
     1027 No newline at end of file