add_clean_index( string $table, string $index )
Adds an index to a specified table.
Parameters
- $table
-
(Required) Database table name.
- $index
-
(Required) Database table index column.
Return
(true) True, when done with execution.
Source
File: wp-admin/includes/upgrade.php
function add_clean_index($table, $index) {
global $wpdb;
drop_index($table, $index);
$wpdb->query("ALTER TABLE `$table` ADD INDEX ( `$index` )");
return true;
}
Changelog
Version | Description |
---|---|
WP-1.0.1 | Introduced. |