Summery Summery

Upgrades the core of WordPress.

Syntax Syntax

update_core( string $from, string $to )

Description Description

This will create a .maintenance file at the base of the WordPress directory to ensure that people can not access the web site, when the files are being copied to their locations.

The files in the $_old_files list will be removed and the new files copied from the zip file after the database is upgraded.

The files in the $_new_bundled_files list will be added to the installation if the version is greater than or equal to the old version being upgraded.

The steps for the upgrader for after the new release is downloaded and unzipped is:

  1. Test unzipped location for select files to ensure that unzipped worked.
  2. Create the .maintenance file in current WordPress base.
  3. Copy new WordPress directory over old WordPress files.
  4. Upgrade WordPress to new version. 4.1. Copy all files/folders other than wp-content 4.2. Copy any language files to WP_LANG_DIR (which may differ from WP_CONTENT_DIR 4.3. Copy any new bundled themes/plugins to their respective locations
  5. Delete new WordPress directory path.
  6. Delete .maintenance file.
  7. Remove old files.
  8. Delete ‘update_core’ option.

There are several areas of failure. For instance if PHP times out before step 6, then you will not be able to access any portion of your site. Also, since the upgrade will not continue where it left off, you will not be able to automatically remove old files and remove the ‘update_core’ option. This isn’t that bad.

If the copy of the new WordPress over the old fails, then the worse is that the new WordPress directory will remain.

If it is assumed that every file will be copied over, including plugins and themes, then if you edit the default theme, you should rename it, so that your changes remain.

Parameters Parameters


(string) (Required) New release unzipped path.


(string) (Required) Path to old WordPress installation.

Return Return

(string|WP_Error) New WordPress version on success, WP_Error on failure.

Source Source

File: wp-admin/includes/update-core.php



Changelog Changelog

Version Description
2.7.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.