make_db_current() WordPress Function

The make_db_current() function is a tool for updating your WordPress database. It compares the current database version with the latest version available, and updates the database if necessary.

make_db_current( string $tables = 'all' ) #

Updates the database tables to a new schema.


Description

By default, updates all the tables to use the latest defined schema, but can also be used to update a specific set of tables in wp_get_db_schema().


Top ↑

Parameters

$tables

(string)(Optional) Which set of tables to update. Default is 'all'.

Default value: 'all'


Top ↑

Source

File: wp-admin/includes/upgrade.php

function make_db_current( $tables = 'all' ) {
	$alterations = dbDelta( $tables );
	echo "<ol>\n";
	foreach ( $alterations as $alteration ) {
		echo "<li>$alteration</li>\n";
	}
	echo "</ol>\n";
}


Top ↑

Changelog

Changelog
VersionDescription
1.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.