WordPress 功能函数—— add_clean_index(向指定的表添加索引)
描述
向指定的表添加索引。
用法
add_clean_index( string $table, string $index )
参数
$table
(string)(必填)数据库表的名称。
$index
(string)(必填)数据库表索引列。
返回
(true) 真,当执行完成时。
来源
文件: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;
}
\u5411\u6307\u5b9a\u7684\u8868\u6dfb\u52a0\u7d22\u5f15\u3002
\u7528\u6cd5
add_clean_index(string\u2026","thumb":"https:\/\/demo.salongweb.com\/mnews\/images\/default-thumb.jpg","date":{"day":"04","year":"2019\/04"},"desc":"WordPress\u4e3b\u9898|WordPress \u4f01\u4e1a\u4e3b\u9898|WordPress \u5546\u57ce\u4e3b\u9898|\u9ad8\u54c1\u8d28\u7f51\u7ad9\u5b9a\u5236","style":{"light":{"logo":"https:\/\/pic.salongweb.com\/2022\/12\/logo-light.png","title":"#242F40","text":"#5B6B82","meta":"#9AA7B9","border":"#EFF5FF","bg":"#fff"},"dark":{"logo":"https:\/\/pic.salongweb.com\/2022\/12\/logo-dark.png","title":"#B1C1E8","text":"#b3bdd3","meta":"#565E75","border":"#1C2032","bg":"#171B2C"}}} :loading="posterLoading">