add_clean_index()
Adds an index to a specified table.
Хуков нет.
Возвращает
true
. True, when done with execution.
Использование
add_clean_index( $table, $index );
- $table(строка) (обязательный)
- Database table name.
- $index(строка) (обязательный)
- Database table index column.
Заметки
- Global. wpdb. $wpdb WordPress database abstraction object.
Список изменений
С версии 1.0.1 | Введена. |
Код add_clean_index() add clean index WP 6.7.1
function add_clean_index( $table, $index ) { global $wpdb; drop_index( $table, $index ); $wpdb->query( "ALTER TABLE `$table` ADD INDEX ( `$index` )" ); return true; }