make_db_current

函式
make_db_current ( $tables = 'all' )
引數
  • (string) $tables Optional. Which set of tables to update. Default is 'all'.
    Required:
    Default: 'all'
定義位置
相關方法
make_db_current_silentget_current_sitemaybe_add_columnset_current_userget_current_theme
引入
1.5.0
棄用
-

make_db_current:這是WordPress中的一個函式,用於更新WordPress資料庫模式,以匹配當前版本的WordPress。你可以使用這個函式來確保你的資料庫是最新的並與最新版本的WordPress相容。

將資料庫表更新為新的模式。

預設情況下,更新所有的表以使用最新定義的模式,但也可以用來更新wp_get_db_schema()中的一組特定的表。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function make_db_current( $tables = 'all' ) {
$alterations = dbDelta( $tables );
echo "<ol>n";
foreach ( $alterations as $alteration ) {
echo "<li>$alteration</li>n";
}
echo "</ol>n";
}
function make_db_current( $tables = 'all' ) { $alterations = dbDelta( $tables ); echo "<ol>n"; foreach ( $alterations as $alteration ) { echo "<li>$alteration</li>n"; } echo "</ol>n"; }
function make_db_current( $tables = 'all' ) {
	$alterations = dbDelta( $tables );
	echo "<ol>n";
	foreach ( $alterations as $alteration ) {
		echo "<li>$alteration</li>n";
	}
	echo "</ol>n";
}

常見問題

FAQs
檢視更多 >