add_clean_index

Advertisement

Summery Summery

Adds an index to a specified table.

Syntax Syntax

add_clean_index( string $table, string $index )

Parameters Parameters

$table

(string) (Required) Database table name.

$index

(string) (Required) Database table index column.

Return Return

(true) True, when done with execution.

Source 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;
}

Advertisement

Changelog Changelog

Changelog
Version Description
1.0.1 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.